Deploy JHipster Lite #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy JHipster Lite | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
pipeline: | |
name: Deploy to GCP | |
runs-on: ubuntu-latest | |
timeout-minutes: 40 | |
steps: | |
- name: 'Setup: checkout project' | |
uses: actions/checkout@v4 | |
- name: 'Setup: 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: 'Setup: authenticate to Google Cloud' | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: 'Setup: 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: 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 to GCP' | |
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//./-} |