-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 1.76 KB
/
deploy-server-develop.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
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy server (development version)
on: workflow_call
jobs:
server-publish-image-develop:
runs-on: ubuntu-latest
# environment: develop
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
file: server.Dockerfile
push: true
tags: ghcr.io/cavoke-project/cavoke-server:latest # TODO: different tag for different branches
server-deploy-cloud-run-develop:
runs-on: ubuntu-latest
environment:
name: develop
url: https://develop.api.cavoke.wlko.me
concurrency: develop
needs: [ server-publish-image-develop ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ env.PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: 'Deploy to Cloud Run'
run: |
gcloud components install beta && \
gcloud beta run deploy cavoke-server-develop \
--execution-environment gen2 \
--source server/.gcp \
--allow-unauthenticated \
--service-account ${{ env.SERVICE_ACCOUNT }} \
--region=${{ env.REGION }} \
--update-env-vars BUCKET=${{ env.BUCKET_NAME }}
env:
PROJECT_ID: waleko-personal
SERVICE_ACCOUNT: fs-identity
BUCKET_NAME: cavoke-test-1
REGION: europe-north1