ci: use gh-pages

This commit is contained in:
Viren070
2024-10-12 14:58:48 +01:00
parent 9b777bd06e
commit d7c1c92337
+13 -25
View File
@@ -3,7 +3,7 @@ name: Build and Deploy to GitHub Pages
on:
push:
branches:
- main
- "**" # Trigger on all branches
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
@@ -24,28 +24,16 @@ jobs:
run: npm ci
- name: Build website
run: npm run build
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build
deploy:
name: Deploy to GitHub Pages
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Create build directory
run: mkdir -p ./build/${{ github.head_ref || github.ref_name }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
if: github.actor != 'dependabot[bot]'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
destination_dir: ${{ github.head_ref || github.ref_name }}
allow_empty_commit: true