-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.13 KB
/
deploy.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: Push Deployment
on:
push:
branches:
- "master"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: 'actions/checkout@v4'
- name: Authenticate with Google Cloud
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
export_default_credentials: true
- name: Build and Push
env:
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}
REPO: ${{ secrets.REPO }}
run: |
gcloud auth configure-docker europe-west1-docker.pkg.dev
docker build -t europe-west1-docker.pkg.dev/$GCLOUD_PROJECT_ID/$REPO/nestapp:latest .
docker push europe-west1-docker.pkg.dev/$GCLOUD_PROJECT_ID/$REPO/nestapp:latest
- name: Deploy
env:
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}
REPO: ${{ secrets.REPO }}
run: |
gcloud run deploy task-manager \
--region europe-west1 \
--image=europe-west1-docker.pkg.dev/$GCLOUD_PROJECT_ID/$REPO/nestapp \
--allow-unauthenticated