mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-17 17:21:48 +00:00
Add Google API credentials to deployment workflow `npm run deploy` runs `build` which needs the env vars
32 lines
847 B
YAML
32 lines
847 B
YAML
name: Deploy to GitHub Pages
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18.x
|
|
cache: 'npm'
|
|
- run: npm ci
|
|
- run: npm run build
|
|
env:
|
|
VITE_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
|
|
VITE_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
|
|
- name: Deploy
|
|
run: |
|
|
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
|
|
npm run deploy -- -u "github-actions-bot <support+actions@github.com>"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
VITE_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
|
|
VITE_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|