fix(github actions): testing push with --all-tags flag #7
This file contains 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: Rollouts Demo -- Build and Push Container Images to GAR | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: {} | |
env: | |
IMAGE_NAME: rollouts-demo | |
GAR_LOCATION: us | |
GCP_PROJECT_ID: moz-fx-cicd-demos-nonprod | |
IMAGE_NAMESPACE: us-docker.pkg.dev/moz-fx-cicd-demos-nonprod/cicd-demos-nonprod | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run the release script to build demo container images | |
run: ./release.sh | |
push: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v2 | |
- id: gcp-auth | |
name: Google authentication | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: "access_token" | |
service_account: artifact-writer@${{ env.GCP_PROJECT_ID }}.iam.gserviceaccount.com | |
workload_identity_provider: ${{ vars.GCPV2_GITHUB_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Log in to the container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.gcp-auth.outputs.access_token }} | |
- name: Push images to GAR | |
run: | | |
docker push --all-tags ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} |