Merge pull request #68 from splitio/vulnerabilities #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |