Skip to content

Update workflow file #5

Update workflow file

Update workflow file #5

name: Build Offline Frontend
on:
push:
branches:
- main
paths:
- frontend/**
- .github/workflows/build-offline-frontend.yml
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
build-offline-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Build Frontend
working-directory: frontend
run: |
sed -i '/base: /s/ \/\// /g' vite.config.js
npm install
npm run build -- --mode offline
- name: Archive offline frontend
uses: actions/upload-artifact@v3
with:
name: rpv-web-offline
path: 'frontend/dist'
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'frontend/dist'
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build-offline-frontend
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2