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 : docker
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : read
10+ id-token : write
11+
12+ jobs :
13+ build-docker-image :
14+ name : Build and push Docker image
15+ runs-on : ubuntu-latest
16+ strategy :
17+ matrix :
18+ fips_mode : [enabled, disabled]
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+
23+ - name : Login to DockerHub
24+ uses : docker/login-action@v3
25+ with :
26+ username : ${{ vars.DOCKERHUB_USERNAME }}
27+ password : ${{ secrets.DOCKERHUB_RO_TOKEN }}
28+
29+ - name : Configure AWS credentials
30+ if : ${{ github.event_name == 'push' }}
31+ uses : aws-actions/configure-aws-credentials@v5
32+ with :
33+ role-to-assume : ${{ vars.ECR_TESTING_ROLE_ARN }}
34+ aws-region : us-east-1
35+
36+ - name : Login to Amazon ECR
37+ if : ${{ github.event_name == 'push' }}
38+ uses : aws-actions/amazon-ecr-login@v2
39+
40+ - name : Set VERSION env
41+ run : echo "VERSION=$(cat splitio/version.go | grep 'Version =' | awk '{print $4}' | tr -d '"')" >> $GITHUB_ENV
42+
43+ - name : Docker Build and Push
44+ uses : docker/build-push-action@v6
45+ with :
46+ context : .
47+ file : " infra/sidecar.Dockerfile"
48+ push : true
49+ tags : |
50+ ${{ vars.ECR_TESTING_URL }}/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }}
51+ build-args : |
52+ FIPS_MODE=${{ matrix.fips_mode }}
Original file line number Diff line number Diff line change 1+ name : unstable
2+ on :
3+ push :
4+ branches-ignore :
5+ - main
6+
7+ permissions :
8+ contents : read
9+ id-token : write
10+
11+ jobs :
12+ push-docker-image :
13+ name : Build and Push Docker Image
14+ runs-on : ubuntu-latest
15+ strategy :
16+ matrix :
17+ fips_mode : [enabled, disabled]
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+
22+ - name : Login to DockerHub
23+ uses : docker/login-action@v3
24+ with :
25+ username : ${{ vars.DOCKERHUB_USERNAME }}
26+ password : ${{ secrets.DOCKERHUB_RO_TOKEN }}
27+
28+ - name : Configure AWS credentials
29+ if : ${{ github.event_name == 'push' }}
30+ uses : aws-actions/configure-aws-credentials@v5
31+ with :
32+ role-to-assume : ${{ vars.ECR_TESTING_ROLE_ARN }}
33+ aws-region : us-east-1
34+
35+ - name : Login to ECR
36+ if : ${{ github.event_name == 'push' }}
37+ uses : aws-actions/amazon-ecr-login@v2
38+
39+ - name : Get short hash
40+ run : echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
41+
42+ - name : Docker Build and Push
43+ uses : docker/build-push-action@v6
44+ with :
45+ context : .
46+ file : " infra/sidecar.Dockerfile"
47+ push : true
48+ tags : |
49+ ${{ vars.ECR_TESTING_URL }}/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || '' }}:${{ env.SHORT_SHA }}
50+ build-args : |
51+ FIPS_MODE=${{ matrix.fips_mode }}
You can’t perform that action at this time.
0 commit comments