-
-
Notifications
You must be signed in to change notification settings - Fork 216
47 lines (41 loc) · 1.71 KB
/
deploy.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
name: Deploy JHipster Lite
on:
workflow_dispatch:
push:
branches:
- gcp
jobs:
pipeline:
name: jhipster-lite deployment
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: 'Setup: checkout project'
uses: actions/checkout@v4
# Substitutes the variables/secrets
- uses: microsoft/variable-substitution@v1
with:
files: '${{ github.workspace }}/app.yaml'
env:
env_variables.GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
env_variables.GCP_REGION: ${{ secrets.GCP_REGION }}
# Setup Google Cloud
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
version: '418.0.0'
project_id: ${{ secrets.GCP_PROJECT_ID }}
# Authenticate and push docker image to Artifact registry
- name: Build and Push Docker Image
run: >-
gcloud auth configure-docker europe-west9-docker.pkg.dev &&
docker build -t europe-west9-docker.pkg.dev/jhipster-lite/jhipster-lite/jhipster-lite:${GITHUB_SHA} . &&
docker push europe-west9-docker.pkg.dev/jhipster-lite/jhipster-lite/jhipster-lite:${GITHUB_SHA}
# Deploy to App Engine Flexible
- name: Deploy
# run: VERSION_TAG=${GITHUB_REF:10} && gcloud app deploy --image-url europe-west9-docker.pkg.dev/jhipster-lite/jhipster-lite/jhipster-lite:${GITHUB_SHA} --version ${VERSION_TAG//./-}
run: gcloud app deploy --image-url europe-west9-docker.pkg.dev/jhipster-lite/jhipster-lite/jhipster-lite:${GITHUB_SHA} --version gcp