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