Deploy web to Github Pages #72
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 web to Github Pages | |
permissions: | |
contents: write # This is required to push to the repository (gh-pages branch) | |
on: | |
push: | |
branches: [ "release" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
defaults: | |
run: | |
working-directory: ./web | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache-dependency-path: ./web/package-lock.json | |
cache: npm | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
env: | |
VITE_API_URL: ${{ secrets.API_URL }} | |
VITE_API_USER: ${{ secrets.API_USER }} | |
VITE_API_PASS: ${{ secrets.API_PASS }} | |
run: npm run build | |
- name: Deploy with gh-pages | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
npx gh-pages -d dist -u "github-actions-bot <[email protected]>" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |