Skip to content

Add details on delegation mode #32

Add details on delegation mode

Add details on delegation mode #32

Workflow file for this run

name: Publish to GH Pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
ref: main
submodules: true
- name: Checkout destination
uses: actions/checkout@v3
with:
ref: gh-pages
path: built-site
- name: Clean built-site
run: rm -rf ${GITHUB_WORKSPACE}/built-site/*
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install npm dependencies
run: npm install
- name: Setup Hugo
run: |
curl -L -o /tmp/hugo.tar.gz 'https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_extended_0.110.0_linux-amd64.tar.gz'
tar -C /usr/local/bin -zxvf /tmp/hugo.tar.gz hugo
- name: Build
run: /usr/local/bin/hugo --cleanDestinationDir --gc
- name: Copy new build to built-site
run: cp -R public/* ${GITHUB_WORKSPACE}/built-site/
- name: Create CNAME file
run: echo 'tratteria.io' > ${GITHUB_WORKSPACE}/built-site/CNAME
- name: Deploy to gh-pages
run: |
cd ${GITHUB_WORKSPACE}/built-site
git add .
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git commit -m "Deploying to gh-pages from main"
git push origin gh-pages --force