updated workflow

This commit is contained in:
Kristian Krsnik 2023-08-18 18:56:57 +02:00
parent bf3ee85df5
commit d47d3a3f34

View File

@ -4,8 +4,7 @@ name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@ -30,26 +29,34 @@ defaults:
jobs:
# Build job
build:
runs-on: nixos/nix
steps:
runs-on: ubuntu-latest
container:
image: nixos/nix
env:
HUGO_VERSION: 0.114.0
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Hugo
run: "nix build --experimental-features 'nix-command flakes' && cp -r result/. public/"
- name: Build with Nix
run: "nix build --experimental-features 'nix-command flakes'"
- name: Copy public folder
run: "cp -r result/. public/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deployment job
deploy:
runs-on: nixos/nix
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages