Create pages.yml #2
This file contains hidden or 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 to GitHub-Pages | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js 16 | |
uses: actions/setup-node@v3 | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Build & Optimise Code | |
run: npm run build | |
- name: Export Static Code | |
run: npm run export | |
- name: Touch nojekyll File | |
run: touch ./out/.nojekyll | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: out/ | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
with: | |
preview: true |