Deploy client #2
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 client | |
on: | |
workflow_run: | |
workflows: ['Test'] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v2 | |
id: root-npm-cache | |
with: | |
path: 'node_modules' | |
key: root-npm-${{ hashFiles('package-lock.json') }} | |
- uses: actions/cache@v2 | |
id: client-npm-cache | |
with: | |
path: 'client/node_modules' | |
key: client-npm-${{ hashFiles('client/package-lock.json') }} | |
- uses: actions/cache@v2 | |
id: server-npm-cache | |
with: | |
path: 'server/node_modules' | |
key: server-npm-${{ hashFiles('server/package-lock.json') }} | |
- run: npm install | |
if: steps.root-npm-cache.outputs.cache-hit != 'true' | |
- run: npm install --prefix client | |
if: steps.client-npm-cache.outputs.cache-hit != 'true' | |
- run: npm install --prefix server | |
if: steps.server-npm-cache.outputs.cache-hit != 'true' | |
- run: npm run build --prefix client | |
env: | |
API_BASE_PATH: ${{ vars.API_BASE_PATH }} | |
API_ORIGIN: ${{ vars.API_ORIGIN }} | |
NEXT_PUBLIC_FIREBASE_CONFIG: ${{ vars.NEXT_PUBLIC_FIREBASE_CONFIG }} | |
NEXT_PUBLIC_GA_ID: ${{ vars.NEXT_PUBLIC_GA_ID }} | |
- run: touch ./client/out/.nojekyll | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./client/out |