Format workflows
All checks were successful
Build and deploy site / Build and deploy site (push) Successful in 1m24s

This commit is contained in:
Marko Korhonen 2024-04-04 18:43:37 +03:00
parent ef6d3838d4
commit 3ec0c545cd
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
2 changed files with 22 additions and 5 deletions

View file

@ -1,7 +1,10 @@
name: Build and deploy site name: Build and deploy site
on: [push] on: [push]
env: env:
GOROOT: /usr/local/lib/go GOROOT: /usr/local/lib/go
jobs: jobs:
deploy_site: deploy_site:
name: Build and deploy site name: Build and deploy site
@ -10,10 +13,13 @@ jobs:
image: git.korhonen.cc/functionalhacker/hugo-asciidoc-docker-ci:latest image: git.korhonen.cc/functionalhacker/hugo-asciidoc-docker-ci:latest
volumes: volumes:
- caddy_korhonen_cc:/public - caddy_korhonen_cc:/public
steps: steps:
- name: Checkout - name: Checkout
uses: https://github.com/actions/checkout@v4 uses: https://github.com/actions/checkout@v4
- name: Install NPM packages - name: Install NPM packages
run: npm install run: npm install
- name: Run Hugo - name: Run Hugo
run: hugo --gc --minify --cleanDestinationDir -d /public run: hugo --gc --minify --cleanDestinationDir -d /public

View file

@ -1,38 +1,49 @@
name: Build and deploy site name: Build and deploy site
on: [push] on: [push]
env: env:
GOROOT: /usr/local/lib/go GOROOT: /usr/local/lib/go
permissions: permissions:
contents: read contents: read
pages: write pages: write
id-token: write id-token: write
jobs: jobs:
build: build:
name: Build site name: Build site
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker://git.korhonen.cc/functionalhacker/hugo-asciidoc-docker-ci:latest image: docker://git.korhonen.cc/functionalhacker/hugo-asciidoc-docker-ci:latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Fix git ownership - name: Fix git ownership
run: git config --global --add safe.directory /__w/korhonen.cc/korhonen.cc run: git config --global --add safe.directory /__w/korhonen.cc/korhonen.cc
- name: Install NPM packages - name: Install NPM packages
run: npm install run: npm install
- name: Run Hugo - name: Run Hugo
run: hugo --gc --minify -d /public run: hugo --gc --minify -d /public
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: /public path: /public
deploy: deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Deploy site to GitHub Pages name: Deploy site to GitHub Pages
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps: steps:
- name: Deploy site to GitHub Pages - name: Deploy site to GitHub Pages
id: deployment id: deployment