Skip to content

demo

demo #681

Workflow file for this run

name: Build & Deploy
on:
push:
branches: ["main"]
workflow_dispatch:
workflow_run:
workflows: ["Update and parse RSS feeds"]
types: [completed]
permissions:
contents: write
jobs:
build-and-deploy:
if: >-
${{
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.actor != 'github-actions[bot]')
}}
runs-on: ubuntu-latest
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Clean install
run: |
rm -rf node_modules package-lock.json
npm install
- name: Build site
run: npm run build
- name: Configure git author (required by gh-pages)
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy to GitHub Pages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx gh-pages -d build --dotfiles --cname showcases.giacomo.website \
-r https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git