Skip to content

Set up deployment

Set up deployment #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
pull_request:
env:
HUGO_VERSION: 0.147.8
GH_USER: cloud-cannon-teamdev-integration
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache Hugo Modules
uses: actions/cache@v4
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Prepare Environment
run: git config --global url."https://${{ env.GH_USER }}:${{ secrets.GH_PAT }}@github.com".insteadOf "https://github.com"
- name: Install Dependencies
working-directory: site
run: npm ci
- name: Build Spine
working-directory: site
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./site/public