-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (44 loc) · 1.41 KB
/
docker.yml
File metadata and controls
52 lines (44 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: docker
on:
push:
branches:
- main
permissions:
contents: read
id-token: write
jobs:
build-docker-image:
name: Build and push Docker image
runs-on: ubuntu-latest
strategy:
matrix:
fips_mode: [enabled, disabled]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_RO_TOKEN }}
- name: Configure AWS credentials
if: ${{ github.event_name == 'push' }}
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ vars.ECR_TESTING_ROLE_ARN }}
aws-region: us-east-1
- name: Login to Amazon ECR
if: ${{ github.event_name == 'push' }}
uses: aws-actions/amazon-ecr-login@v2
- name: Set VERSION env
run: echo "VERSION=$(cat splitio/version.go | grep 'Version =' | awk '{print $4}' | tr -d '"')" >> $GITHUB_ENV
- name: Docker Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: "infra/sidecar.Dockerfile"
push: true
tags: |
${{ vars.ECR_TESTING_URL }}/splitd/sidecar${{ matrix.fips_mode == 'enabled' && '-fips' || ''}}:${{ env.VERSION }}
build-args: |
FIPS_MODE=${{ matrix.fips_mode }}