mirror of
https://github.com/gramps-project/gramps-web.git
synced 2026-04-18 13:18:49 -04:00
45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
name: Deploy demo
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: "16"
|
|
- name: Install and Build
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
- name: Move files
|
|
run: mv dist demo/
|
|
- name: Build image
|
|
run: |
|
|
cd demo && docker build . \
|
|
--tag gcr.io/gramps-web-demo/gcp-api:latest \
|
|
-f Dockerfile
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
permissions:
|
|
contents: "read"
|
|
id-token: "write"
|
|
steps:
|
|
- id: "auth"
|
|
uses: "google-github-actions/auth@v0"
|
|
with:
|
|
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"
|
|
- id: "deploy"
|
|
uses: "google-github-actions/deploy-cloudrun@v0"
|
|
with:
|
|
service: "gcp-api"
|
|
image: "gcr.io/gramps-web-demo/gcp-api:latest"
|