-
Notifications
You must be signed in to change notification settings - Fork 147
70 lines (57 loc) · 1.95 KB
/
deploy_artifact_proxy_dev.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Deploy Artifact Proxy Dev
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/deploy_artifact_proxy.yaml
- "packages/artifact_proxy/**"
env:
PROJECT_ID: code-push-dev
SERVICE: artifact-proxy
REGION: us-central1
CONTAINER_REGISTRY: us-docker.pkg.dev
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/artifact_proxy
name: ☁️ Artifact Proxy
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🎯 Setup Dart
uses: dart-lang/setup-dart@v1
- name: 🔐 GCloud Auth
uses: google-github-actions/auth@v2
with:
project_id: ${{ env.PROJECT_ID }}
credentials_json: ${{ secrets.CLOUD_RUN_SA_DEV }}
export_environment_variables: true
- name: ☁️ Setup GCloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ env.PROJECT_ID }}
- name: 🔓 Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: _json_key
password: ${{ secrets.CLOUD_RUN_SA_DEV }}
- name: 🐳 Build and Push Container
run: |-
docker build -t ${{ env.CONTAINER_REGISTRY }}/${{ env.PROJECT_ID }}/us.gcr.io/${{ env.SERVICE }}:${{ github.sha }} .
docker push ${{ env.CONTAINER_REGISTRY }}/${{ env.PROJECT_ID }}/us.gcr.io/${{ env.SERVICE }}:${{ github.sha }}
- name: 🚀 Deploy to Cloud Run
id: deploy
uses: google-github-actions/[email protected]
with:
service: ${{ env.SERVICE }}
image: ${{ env.CONTAINER_REGISTRY }}/${{ env.PROJECT_ID }}/us.gcr.io/${{ env.SERVICE }}:${{ github.sha }}
region: ${{ env.REGION }}
- name: 👀 Show Output
run: echo ${{ steps.deploy.outputs.url }}