diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 63efdb6..1ad69d1 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -13,35 +13,35 @@ clone: steps: # Build zola static files build: - image: alpine + image: alpine:edge commands: - apk add zola + - zola --version - zola build when: - event: [ pull_request, push ] + event: [push, pull_request, manual] publish: image: bitnami/git # Must be set in Woodpecker configuration - secrets: [ mail, codeberg_token ] + secrets: [mail, codeberg_token] commands: - # Save .domains - # - domains=$(cat .domains) # Git configuration - git config --global user.email $MAIL - git config --global user.name "Woodpecker CI" + # Clone output branch - git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME - # Enter repository folder + # Enter output branch folder - cd $CI_REPO_NAME - # Remove old files from repository folder - - git rm -r "*" - # Copy build step output to repository folder + # Remove old files + - git rm -r "*" || true # Ignore if it's empty + # Copy build step output - cp -ar ../public/. . - # Add .domains back - # - echo $domains > .domains + # Needed for custom domains + - cp ../.domains . || true # Ignore if it doesn't exist # Commit and push all static files with source commit SHA - git add --all - - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" + - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" || true - git push when: - event: push + event: [push, manual]