Skip to content

Merge pull request #1 from Travelopia/add/deployment-workflow #1

Merge pull request #1 from Travelopia/add/deployment-workflow

Merge pull request #1 from Travelopia/add/deployment-workflow #1

Workflow file for this run

name: GitHub Pages Deployment
on:
workflow_dispatch:
push:
branches:
- main
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false # Let all the deployments go through.
jobs:
build:
runs-on: ubuntu-latest
permissions:
pages: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- name: Configure Node.js cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
id: node-npm-cache
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: "5"
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}
- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
with:
node-version-file: ".nvmrc"
- name: Install dependencies
if: ${{ steps.node-npm-cache.outputs.cache-hit != 'true' }}
run: npm ci
- name: Build website
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b #v5.0.0
- name: Upload build artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa #v3.0.1
with:
name: handbook-build
path: ./dist
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
contents: read
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5
with:
artifact_name: handbook-build