Github Pages Astro CI #1041
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
# Workflow to build and deploy to your GitHub Pages repo. | |
# Edit your project details here. | |
# Remember to add API_TOKEN_GITHUB in repo Settings > Secrets as well! | |
env: | |
githubEmail: <YOUR GITHUB EMAIL ADDRESS> | |
deployToRepo: <NAME OF REPO TO DEPLOY TO (E.G. <YOUR USERNAME>.github.io)> | |
name: Github Pages Astro CI | |
on: | |
# Triggers the workflow on push and pull request events but only for the main branch | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_run: | |
workflows: ["Scan YTube"] | |
types: | |
- completed | |
# Allows you to run this workflow manually from the Actions tab. | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Install dependencies with npm | |
- name: Install dependencies | |
run: cd website && npm install | |
# Build the project and add .nojekyll file to supress default behaviour | |
- name: Build | |
run: | | |
cd website | |
npm run build | |
touch ./dist/.nojekyll | |
# Push to your pages repo | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4.3.0 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: website/dist # The folder the action should deploy. |