Update CI to match my personal one
This commit is contained in:
@ -13,35 +13,35 @@ clone:
|
|||||||
steps:
|
steps:
|
||||||
# Build zola static files
|
# Build zola static files
|
||||||
build:
|
build:
|
||||||
image: alpine
|
image: alpine:edge
|
||||||
commands:
|
commands:
|
||||||
- apk add zola
|
- apk add zola
|
||||||
|
- zola --version
|
||||||
- zola build
|
- zola build
|
||||||
when:
|
when:
|
||||||
event: [ pull_request, push ]
|
event: [push, pull_request, manual]
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
image: bitnami/git
|
image: bitnami/git
|
||||||
# Must be set in Woodpecker configuration
|
# Must be set in Woodpecker configuration
|
||||||
secrets: [mail, codeberg_token]
|
secrets: [mail, codeberg_token]
|
||||||
commands:
|
commands:
|
||||||
# Save .domains
|
|
||||||
# - domains=$(cat .domains)
|
|
||||||
# Git configuration
|
# Git configuration
|
||||||
- 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
|
||||||
- git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
|
- 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
|
- cd $CI_REPO_NAME
|
||||||
# Remove old files from repository folder
|
# Remove old files
|
||||||
- git rm -r "*"
|
- git rm -r "*" || true # Ignore if it's empty
|
||||||
# Copy build step output to repository folder
|
# Copy build step output
|
||||||
- cp -ar ../public/. .
|
- cp -ar ../public/. .
|
||||||
# Add .domains back
|
# Needed for custom domains
|
||||||
# - echo $domains > .domains
|
- cp ../.domains . || true # Ignore if it doesn't exist
|
||||||
# Commit and push all static files with source commit SHA
|
# 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]"
|
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" || true
|
||||||
- git push
|
- git push
|
||||||
when:
|
when:
|
||||||
event: push
|
event: [push, manual]
|
||||||
|
Reference in New Issue
Block a user