chore: Optimize CI

This commit is contained in:
daudix-UFO
2023-12-25 04:42:30 +03:00
parent bc0033a245
commit 38208f1c52

View File

@ -24,26 +24,19 @@ steps:
image: bitnami/git
# Must be set in Woodpecker configuration
secrets: [ mail, codeberg_token ]
environment:
- ZOLA_OUTPUT=public
commands:
# Git configuration
- git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI"
- git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
# Remove old files from repository
- ls # Debug
# Enter repository folder
- cd $CI_REPO_NAME
- ls # Debug
# Remove old files from repository folder
- git rm -r "*"
- ls # Debug
- cd ..
# Copy build step output to repository folder
- cp -ar $ZOLA_OUTPUT/. $CI_REPO_NAME/
- ls # Debug
# Commit and push all static files with pipeline started timestamp
- cd $CI_REPO_NAME
- git add .
- cp -ar ../public/. $CI_REPO_NAME/
# Commit and push all static files with source commit SHA
- git add -A
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]"
- git push
when: