cicd: permissions tweaks #2
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: Docker Image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-push-image: | |
name: "Synchro Image" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: GCP Workload Identity Auth | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }} | |
- name: "Auth to AR" | |
run: gcloud auth configure-docker us-east4-docker.pkg.dev | |
- name: "Push to AR" | |
run: | | |
cd services/synchro | |
docker build . \ | |
-f Dockerfile \ | |
-t us-east4-docker.pkg.dev/surface-420608/stable/synchro-kotlin:${GITHUB_SHA::6} \ | |
-t us-east4-docker.pkg.dev/surface-420608/stable/synchro-kotlin:latest | |
docker push us-east4-docker.pkg.dev/surface-420608/stable/synchro-kotlin:${GITHUB_SHA::6} | |
docker push us-east4-docker.pkg.dev/surface-420608/stable/synchro-kotlin:latest |