sarsooxyz.hugo/.github/workflows/pages.yml

72 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2022-08-20 09:43:35 +01:00
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2024-07-02 20:34:03 +01:00
name: Deploy Hugo site to Staging (Pages)
2022-08-20 09:43:35 +01:00
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
2024-07-02 20:30:45 +01:00
name: Build Pages
2022-08-20 09:43:35 +01:00
steps:
- name: Install Hugo CLI
2023-06-26 17:24:59 +01:00
run: sudo apt install hugo
2022-08-20 09:43:35 +01:00
- name: Checkout
uses: actions/checkout@v3
with:
2022-08-21 17:21:38 +01:00
submodules: true
2022-08-20 09:43:35 +01:00
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
2022-08-20 09:43:35 +01:00
- name: Build with Hugo
run: |
hugo \
--minify \
--baseURL ${{ steps.pages.outputs.base_url }}
- name: Write CNAME
2022-09-17 21:07:43 +01:00
run: echo new.sarsoo.xyz > ./public/CNAME
2022-08-21 17:37:15 +01:00
2022-08-20 09:43:35 +01:00
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
# Deployment job
deploy:
2024-07-02 20:30:45 +01:00
name: Deploy Staging
2022-08-20 09:43:35 +01:00
environment:
2024-07-02 20:30:45 +01:00
name: staging
2022-08-20 09:43:35 +01:00
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1