-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (33 loc) · 1.19 KB
/
pull_request.yml
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
name: PR
on:
pull_request:
branches:
- main
jobs:
docker-push:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}
- name: Set Tag and SHA
run: |
CLEAN_TAG=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)
echo "TAG=$CLEAN_TAG" >> $GITHUB_ENV
echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
- name: Build
run: >
docker build -t ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-runner-maintenance-page:$TAG .
- name: Push to GAR
run: |
gcloud auth configure-docker ${{ secrets.GAR_LOCATION }}
echo "Pushing to GAR with tag $TAG"
docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-runner-maintenance-page:$TAG