generated from nimil-jp/go-gin-ddd
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.15 KB
/
deploy-stg.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
name: Deploy to Staging
on:
push:
tags:
- "v*.*.*"
env:
IMAGE: asia-northeast1-docker.pkg.dev/nimil-base/createone/api
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v2
- name: Setup gcloud
uses: ./.github/actions/gcloud
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Build and Push Image
run: |
docker build . -t "$IMAGE:${{ github.ref_name }}"
docker push "$IMAGE:${{ github.ref_name }}"
docker tag "$IMAGE:${{ github.ref_name }}" "$IMAGE:stg"
docker push "$IMAGE:stg"
- name: Deploy
run: |
gcloud run deploy createone-api-stg \
--image "$IMAGE:${{ github.ref_name }}" \
--project ${{ secrets.GCP_PROJECT_ID }} \
--region ${{ secrets.GCP_REGION }} \
--ingress all \
--platform=managed \
--allow-unauthenticated \
--quiet