Remove the .domains copy step from CI

Zola can copy static files to the site root by itself
This commit is contained in:
daudix
2024-07-04 21:47:49 +03:00
parent 6f9c51fa5d
commit 93db7e7bcd
2 changed files with 13 additions and 14 deletions

View File

@ -1,9 +1,9 @@
# Exclude page pipeline to be run on "pages" branch # Exclude the pipeline to run on the pages branch
when: when:
branch: branch:
exclude: pages exclude: pages
# Recursive cloning is used to fully clone the themes given as Git submodules # Clone recursively to fully clone the themes given as Git submodules
clone: clone:
git: git:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
@ -11,7 +11,7 @@ clone:
recursive: true recursive: true
steps: steps:
# Build zola static files # Build Zola static files
build: build:
image: alpine:edge image: alpine:edge
commands: commands:
@ -24,24 +24,24 @@ steps:
publish: publish:
image: bitnami/git image: bitnami/git
# Must be set in Woodpecker configuration # 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] secrets: [mail, codeberg_token]
commands: commands:
# Git configuration # Configure Git
- git config --global user.email $MAIL - git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI" - git config --global user.name "Woodpecker CI"
# Clone output branch # Clone the output branch
- git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME - git clone --branch pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
# Enter output branch folder # Enter the output branch
- cd $CI_REPO_NAME - cd $CI_REPO_NAME
# Remove old files # Remove old files
- git rm -r "*" || true # Ignore if it's empty - git rm -r "*" || true # Don't fail if there's nothing to remove
# Copy build step output # Copy the output of the build step
- cp -ar ../public/. . - cp -ar ../public/. .
# Needed for custom domains # Commit and push all static files with the source commit hash
- cp ../.domains . || true # Ignore if it doesn't exist
# Commit and push all static files with source commit SHA
- git add --all - git add --all
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" || true - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
- git push - git push
when: when:
event: [push, manual] event: [push, manual]

View File

@ -1,3 +1,2 @@
duckquill.daudix.one duckquill.daudix.one
duckquill.daudix.codeberg.page duckquill.daudix.codeberg.page
pages.duckquill.daudix.codeberg.page