Update hugo version #10
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: Deploy live site | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
environment: Production | |
env: | |
CF_PAGES_URL: https://dylanmaassen.nl | |
HUGO_ENV: production | |
HUGO_TITLE: "Dylan's Site" | |
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_PROJECT_NAME: "dylanmaassen-nl" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.139.2' | |
extended: true | |
- name: Build the site | |
run: hugo --baseURL=$CF_PAGES_URL --environment=$HUGO_ENV | |
- name: Deploy with Wrangler | |
run: npx wrangler@2 pages publish ./public --project-name $CLOUDFLARE_PROJECT_NAME --commit-hash ${{ github.sha }} --commit-message "${{ github.event.head_commit.message }}" |