.forgejo/workflows/zola.yaml (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | name: Deploy Zola site to Pages
env:
ZOLA_VERSION: 0.21.0
on:
# Runs on pushes targeting the default branch
push:
branches:
# If you want to build from a different branch, change it here.
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
# You can find the list of available runners on https://codeberg.org/actions/meta, or run one yourself.
runs-on: codeberg-tiny-lazy
container:
image: "alpine:edge"
steps:
- name: Install CI prerequisites
run: |
apk upgrade -Ua
apk add nodejs git 'zola=~${{ env.ZOLA_VERSION }}'
- name: Clone the repository
uses: https://code.forgejo.org/actions/checkout@v5
with:
submodules: recursive
fetch-depth: 0
- name: Generate static files with Zola
run: |
zola build
- name: Upload generated files
uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: Generated files
path: public/
deploy:
needs: [build]
runs-on: codeberg-tiny-lazy
steps:
- name: Clone the repository
uses: https://code.forgejo.org/actions/checkout@v5
with:
submodules: recursive
fetch-depth: 0
- name: Checkout the target branch and clean it up
# If you want to commit to a branch other than "pages", change the two references below, as well as the reference in the last step.
run: |
git checkout pages || git switch --orphan pages && \
rm -Rfv $(ls -A | egrep -v '^(\.git|LICENSE)$')
- name: Download generated files
uses: https://code.forgejo.org/actions/download-artifact@v3
with:
name: Generated files
- name: Publish the website
run: |
git config user.email codeberg-ci && \
git config user.name "Codeberg CI" && \
git add . && \
git commit --allow-empty --message "Codeberg build for ${GITHUB_SHA}" && \
git push origin pages
|