From 659eacfbb76b9eb5873f026ef48bb588eae00eed Mon Sep 17 00:00:00 2001 From: Varakh Date: Mon, 27 Nov 2023 19:58:58 +0100 Subject: [PATCH] Add periodic automatic re-build of latest published version #noissue --- .forgejo/workflows/build.yaml | 38 ++++++++++++------------- .forgejo/workflows/release.yaml | 37 ++++++++++++------------ .forgejo/workflows/release_rebuild.yaml | 33 +++++++++++++++++++++ 3 files changed, 70 insertions(+), 38 deletions(-) create mode 100644 .forgejo/workflows/release_rebuild.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 4d92fe9..64dd63f 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -1,4 +1,4 @@ -on: [ push ] +on: [push] env: REVISION: ${{ github.sha }} jobs: @@ -7,25 +7,25 @@ jobs: container: image: alpine:3.18 steps: - - name: Prepare requirements - run: | - apk add --no-cache nodejs npm git - apk add --no-cache docker docker-cli-buildx + - name: Prepare requirements + run: | + apk add --no-cache nodejs npm git + apk add --no-cache docker docker-cli-buildx - - uses: actions/checkout@v3 - name: Clone + - uses: actions/checkout@v3 + name: Clone - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_KEY }} + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_KEY }} - - name: Build docker image - uses: docker/build-push-action@v4 - with: - push: false - tags: varakh/hetzner-storagebox-exporter:${{ github.sha }} + - name: Build docker image + uses: docker/build-push-action@v4 + with: + push: false + tags: varakh/hetzner-storagebox-exporter:${{ github.sha }} diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index c8cf457..d708f75 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -10,26 +10,25 @@ jobs: container: image: alpine:3.18 steps: - - name: Prepare requirements - run: | - apk add --no-cache nodejs npm git - apk add --no-cache docker docker-cli-buildx + - name: Prepare requirements + run: | + apk add --no-cache nodejs npm git + apk add --no-cache docker docker-cli-buildx - - uses: actions/checkout@v3 - name: Clone + - uses: actions/checkout@v3 + name: Clone - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_KEY }} - - - name: Build docker image - uses: docker/build-push-action@v4 - with: - push: true - tags: varakh/hetzner-storagebox-exporter:latest + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_KEY }} + - name: Build docker image + uses: docker/build-push-action@v4 + with: + push: true + tags: varakh/hetzner-storagebox-exporter:latest diff --git a/.forgejo/workflows/release_rebuild.yaml b/.forgejo/workflows/release_rebuild.yaml new file mode 100644 index 0000000..14ca281 --- /dev/null +++ b/.forgejo/workflows/release_rebuild.yaml @@ -0,0 +1,33 @@ +on: + schedule: + - cron: "0 0 1 * *" +env: + REVISION: ${{ github.sha }} +jobs: + build: + runs-on: docker + container: + image: alpine:3.18 + steps: + - name: Prepare requirements + run: | + apk add --no-cache nodejs npm git + apk add --no-cache docker docker-cli-buildx + + - uses: actions/checkout@v3 + name: Clone + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_KEY }} + + - name: Build docker image + uses: docker/build-push-action@v4 + with: + push: true + tags: varakh/hetzner-storagebox-exporter:latest -- 2.45.2