publish #9
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: publish | |
on: | |
# Enable Manual deployments | |
# https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow | |
workflow_dispatch: | |
# Required Permissions | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Disable pages deployment concurrency | |
# https://docs.github.com/en/actions/using-jobs/using-concurrency | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Build | |
run: | | |
npm ci | |
npm run build | |
touch out/.nojekyll | |
echo "kajgm.com" > out/CNAME | |
- name: Deploy to gh-pages branch | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
npx gh-pages -d out -u "github-actions-bot <[email protected]>" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "./out" | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |