-
Notifications
You must be signed in to change notification settings - Fork 11
39 lines (33 loc) · 1.34 KB
/
mainnet-release-gcr-publish.yaml
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
name: Mainnet Build and Publish Image to GCR
on:
release:
types: [published]
jobs:
deploy_mainnet:
runs-on: ubuntu-latest
if: |
! contains(github.event.release.tag_name, '-rc-')
steps:
- uses: actions/checkout@v2
- name: Setup GCloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Authorize Docker
run: gcloud auth configure-docker
- name: Build and Push Container
run: |-
docker build \
-t gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.SERVICE }}:${{ github.event.release.tag_name }} \
-t gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.SERVICE }}:latest \
-f build/Dockerfile .
docker push gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.SERVICE }}:${{ github.event.release.tag_name }}
docker push gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.SERVICE }}:latest
- name: Dispatch image release event
uses: peter-evans/[email protected]
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: ${{ github.repository }}
event-type: trigger-mainnet-image-release
client-payload: '{"tag": "${{ github.event.release.tag_name }}"}'