From 470a5a0c5a738abaa0b6f3bd94258d0d95bb7994 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Tue, 19 Dec 2023 11:00:27 +0100 Subject: [PATCH] =?UTF-8?q?.gitea/workflows/release.yml=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..cac0f9a --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,25 @@ +name: release + +on: + push: + branches: [ main ] + schedule: + schedule: + - cron: '0 0/1 * * *' + +jobs: + release-image: + runs-on: act-runner-user + steps: + - name: check and update hugo repo + run: | + export NEWEST_HUGO_RELEASE=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases | jq -r '.[0].name' | sed '/s/v//g') + export CURRENT_HUGO_RELEASE=$(curl --user ${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }} https://git.cantorgymnasium.de/api/v1/packages/gcg | jq -r 'map(select( .name | contains("hugo"))) | .[0].version') + if [ $NEWEST_HUGO_RELEASE != $CURRENT_HUGO_RELEASE ]; do curl -O https://github.com/gohugoio/hugo/releases/download/v0.121.1/hugo_extended_$(echo $NEWEST_HUGO_RELEASE)_linux-amd64.deb; curl --user ${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }} --upload-file hugo_extended_$(echo $NEWEST_HUGO_RELEASE)_linux-amd64.deb https://git.cantorgymnasium.de/api/packages/gcg/debian/pool/all/main/upload; done + + - name: notification + uses: actions/telegram-action@main + if: always() + with: + chat_id: ${{ secrets.TG_CHAT_ID }} + token: ${{ secrets.TG_TOKEN }} \ No newline at end of file