Skip to content

Deploy web to Github Pages #72

Deploy web to Github Pages

Deploy web to Github Pages #72

Workflow file for this run

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 }}