github-pages: #4
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: Build ESPlant-Pages | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "ESPlant-Pages/**" | |
- ".github/workflows/build.github-pages.workflow.yml" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
working-directory: ./ESPlant-Pages | |
run: npm install | |
- name: Build pages | |
working-directory: ./ESPlant-Pages | |
run: npm run build | |
- name: upload pages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: github-pages | |
path: ESPlant-Pages/dist | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/upload-pages-artifact@v2 |