-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.58 KB
/
release.yml
File metadata and controls
57 lines (47 loc) · 1.58 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Release
on:
push:
branches: [main]
env:
IMAGE_TAG: sha-${{ github.sha }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
- uses: docker/setup-buildx-action@v3
- name: Configure Docker for Artifact Registry
run: gcloud auth configure-docker ${{ vars.ARTIFACT_REGISTRY_REGION }}-docker.pkg.dev --quiet
- name: Build and push opencase
uses: docker/build-push-action@v6
with:
context: apps/opencase
push: true
tags: ${{ vars.IMAGE_REGISTRY }}/opencase:${{ env.IMAGE_TAG }}
cache-from: type=gha,scope=opencase
cache-to: type=gha,scope=opencase,mode=max
- name: Build and push editor
uses: docker/build-push-action@v6
with:
context: apps/editor
push: true
tags: ${{ vars.IMAGE_REGISTRY }}/editor:${{ env.IMAGE_TAG }}
cache-from: type=gha,scope=editor
cache-to: type=gha,scope=editor,mode=max
trigger-deploy:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DEPLOY_REPO_TOKEN }}
repository: ${{ vars.DEPLOY_REPO }}
event-type: deploy
client-payload: '{"image_tag": "${{ env.IMAGE_TAG }}"}'