.gitea/workflows/release.yml hinzugefügt
This commit is contained in:
parent
199af2a50f
commit
c2a48edc7b
33
.gitea/workflows/release.yml
Normal file
33
.gitea/workflows/release.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0/1 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: act-runner-user
|
||||||
|
steps:
|
||||||
|
- name: check pagefind version
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
export NEWEST_PAGEFIND_RELEASE=$(curl -s https://api.github.com/repos/CloudCannon/pagefind/releases | jq -r '.[0].name')
|
||||||
|
export CURRENT_PAGEFIND_RELEASE=$(curl --user ${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }} https://git.cantorgymnasium.de/api/v1/packages/gcg | jq -r 'map(select( .name | contains("pagefind"))) | .[0].version')
|
||||||
|
echo update_available=$(! [[ $NEWEST_PAGEFIND_RELEASE != $CURRENT_PAGEFIND_RELEASE ]]; echo $?) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: update hugo package
|
||||||
|
if: steps.check.outputs.update_available == 1
|
||||||
|
run: |
|
||||||
|
export NEWEST_PAGEFIND_RELEASE=$(curl -s https://api.github.com/repos/CloudCannon/pagefind/releases | jq -r '.[0].name')
|
||||||
|
curl -LO https://github.com/CloudCannon/pagefind/releases/download/v$(echo $NEWEST_PAGEFIND_RELEASE)/pagefind_extended_$(echo $NEWEST_PAGEFIND_RELEASE)_x86_64-unknown-linux-musl.tar.gz
|
||||||
|
tar -xf pagefind_extended_$(echo $NEWEST_PAGEFIND_RELEASE)_x86_64-unknown-linux-musl.tar.gz
|
||||||
|
curl --user ${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }} --upload-file pagefind_extended https://git.cantorgymnasium.de/api/packages/gcg/generic/hugo/$NEWEST_PAGEFIND_RELEASE/pagefind_extended
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
|
if: steps.check.outputs.update_available == 1
|
||||||
|
run: |
|
||||||
|
export NEWEST_PAGEFIND_RELEASE=$(curl -s https://api.github.com/repos/CloudCannon/pagefind/releases | jq -r '.[0].name')
|
||||||
|
curl -sL https://git.cantorgymnasium.de/api/packages/gcg/generic/hugo/$NEWEST_PAGEFIND_RELEASE/pagefind_extended --output /usr/local/bin/pagefind_extended
|
Loading…
x
Reference in New Issue
Block a user