File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ push :
5+ workflow_dispatch :
6+ inputs :
7+ environment :
8+ type : environment
9+ description : The environment to deploy to.
10+
11+ jobs :
12+ detect-environments :
13+ runs-on : ubuntu-latest
14+ outputs :
15+ environments : ${{ steps.environments.outputs.result }}
16+ steps :
17+ - uses : actions/github-script@v6
18+ id : environments
19+ with :
20+ github-token : ${{ secrets.GITHUB_TOKEN }}
21+ result-encoding : json
22+ script : |
23+ if (context.payload?.inputs?.environment) return [context.payload?.inputs?.environment];
24+ const {data: {environments}} =
25+ await github.request(`GET /repos/${process.env.GITHUB_REPOSITORY}/environments`);
26+ return environments.map(e => e.name)
27+
28+ deploy :
29+ runs-on : ubuntu-latest
30+ env :
31+ DOCKER_REPO : ${{ secrets.DEPLOY_DOCKER_REPOSITORY }}
32+ needs : [detect-environments]
33+ strategy :
34+ matrix :
35+ environment : ${{ fromJSON(needs.detect-environments.outputs.environments) }}
36+ environment : ${{ matrix.environment }}
37+ if : github.ref_name == 'main'
38+ steps :
39+ - uses : actions/checkout@v4
40+
41+ - id : vars
42+ run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
43+
44+ - uses : aws-actions/configure-aws-credentials@v1-node16
45+ with :
46+ aws-access-key-id : ${{ secrets.DEPLOY_AWS_ACCESS_KEY_ID }}
47+ aws-secret-access-key : ${{ secrets.DEPLOY_AWS_SECRET_ACCESS_KEY }}
48+ aws-region : us-east-1
49+
50+ - uses : aws-actions/amazon-ecr-login@v2
51+ with :
52+ registry-type : public
53+
54+ - run : docker pull $DOCKER_REPO:${GITHUB_REF_NAME} || echo "no current latest image"
55+
56+ - run : docker build -t $DOCKER_REPO:${{ steps.vars.outputs.sha_short }} .
57+
58+ - run : docker tag $DOCKER_REPO:${{ steps.vars.outputs.sha_short }} $DOCKER_REPO:${GITHUB_REF_NAME}
59+
60+ - run : docker push $DOCKER_REPO:${{ steps.vars.outputs.sha_short }}
61+
62+ - run : docker push $DOCKER_REPO:${GITHUB_REF_NAME}
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- make data/reporting/duplicate_entity_expectation.csv
5-
6-
7-
4+ make all -j 8
You can’t perform that action at this time.
0 commit comments