Files
blog/.woodpecker.yaml
2024-07-07 19:07:41 +03:00

62 lines
1.9 KiB
YAML

# Exclude the pipeline to run on the pages branch
when:
branch:
exclude: pages
# Clone recursively to fully clone the themes given as Git submodules
clone:
git:
image: woodpeckerci/plugin-git
settings:
recursive: true
steps:
# Check for typos
typos:
image: alpine:edge
commands:
- apk add curl jq
- curl -s "https://api.github.com/repos/crate-ci/typos/releases/latest" | jq -r '.assets[] | select(.name | contains("unknown-linux-musl")) | .browser_download_url' | xargs -n 1 curl -L -o typos.tar.gz
- tar -zxvf typos.tar.gz ./typos
- ./typos
failure: ignore
when:
event: [push, pull_request, manual]
# Build Zola static files
build:
image: alpine:edge
commands:
- apk add zola
- zola --version
- zola build
when:
event: [push, pull_request, manual]
publish:
image: bitnami/git
# Must be set in Woodpecker configuration
# mail: Your email address used by Codebrg
# codeberg_token: Codeberg access token with "write:repository" permission
secrets: [mail, codeberg_token]
commands:
# Configure Git
- git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI"
# Clone the output branch
- git clone --branch pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
# Enter the output branch
- cd $CI_REPO_NAME
# Remove old files
- git rm -r "*" || true # Don't fail if there's nothing to remove
# Copy the output of the build step
- cp -ar ../public/. .
# Copy .domains in place (Duckquill specific. you should just place it in ./static/)
- cp ../.domains .
# Commit and push all static files with the source commit hash
- git add --all
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
- git push
when:
event: [push, manual]