mirror of
https://codeberg.org/openpgp/notes.git
synced 2025-09-09 11:19:41 +02:00
Generate PR previews to pr-preview repo
This commit is contained in:
parent
6760c124e3
commit
4e73dab290
1 changed files with 23 additions and 0 deletions
|
@ -12,6 +12,29 @@ steps:
|
|||
pull_image: false
|
||||
purge: false
|
||||
|
||||
pages-pr-preview:
|
||||
image: bitnami/git
|
||||
secrets: [ codeberg_token ]
|
||||
commands:
|
||||
- git config --global user.email heiko.schaefer+boiler@posteo.de
|
||||
- git config --global user.name "Page Renderer"
|
||||
- git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/openpgp/pr-preview.git pr-preview
|
||||
- rm -rf pr-preview/$CI_COMMIT_PULL_REQUEST
|
||||
- cp -ar public/. pr-preview/$CI_COMMIT_PULL_REQUEST
|
||||
# Needed for custom domains
|
||||
- cp .domains pr-preview || true # Ignore if it doesn't exist
|
||||
- cd pr-preview
|
||||
- >
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
echo "No changes"
|
||||
else
|
||||
git add .
|
||||
git commit -m "Update rendered page" -m "Source: $CI_COMMIT_SHA" -m "See: $CI_BUILD_LINK"
|
||||
git push
|
||||
fi
|
||||
when:
|
||||
event: pull_request
|
||||
|
||||
pages-publish:
|
||||
image: bitnami/git
|
||||
secrets: [ codeberg_token ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue