···11name: Deploy to GitHub Pages
2233on:
44- # Trigger the workflow every time you push to the `main` branch
55- # Using a different branch name? Replace `main` with your branch’s name
64 push:
75 branches: [ main ]
88- # Allows you to run this workflow manually from the Actions tab on GitHub.
96 workflow_dispatch:
1071111-# Allow this job to clone the repo and create a page deployment
128permissions:
139 contents: read
1410 pages: write
···2016 steps:
2117 - name: Checkout your repository using git
2218 uses: actions/checkout@v4
1919+2020+ - name: Set SITE and BASE values if MANUAL_SITE_BASE is false
2121+ run: |
2222+ if jq '.MANUAL_SITE_BASE == false' src/config.json; then
2323+ SITE="https://$GITHUB_ACTOR.github.io"
2424+ BASE="/${GITHUB_REPOSITORY#*/}"
2525+ jq --arg SITE "$SITE" --arg BASE "$BASE" \
2626+ '.SITE = $SITE | .BASE = $BASE' src/config.json > tmp.$$.json && mv tmp.$$.json src/config.json
2727+ fi
2828+2329 - name: Install, build, and upload your site
2430 uses: withastro/action@v3
2525- # with:
2626- # path: . # The root location of your Astro project inside the repository. (optional)
2727- # node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
2828- # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
29313032 deploy:
3133 needs: build
···3638 steps:
3739 - name: Deploy to GitHub Pages
3840 id: deployment
3939- uses: actions/deploy-pages@v44141+ uses: actions/deploy-pages@v4