From c2d461e8d6a141316758cc3ef86ad73703d7e5fc Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Mon, 6 Oct 2025 09:17:42 +0200 Subject: [PATCH] feat(): more refined workflow --- .gitea/workflows/main.yaml | 49 +++++++++++++++++++++++++++++++++++ .gitea/workflows/release.yaml | 46 ++++++++++++++++++++++++++++++++ .woodpecker/main.yaml | 21 --------------- .woodpecker/pr.yaml | 17 ------------ .woodpecker/release.yaml | 20 -------------- 5 files changed, 95 insertions(+), 58 deletions(-) create mode 100644 .gitea/workflows/main.yaml create mode 100644 .gitea/workflows/release.yaml delete mode 100644 .woodpecker/main.yaml delete mode 100644 .woodpecker/pr.yaml delete mode 100644 .woodpecker/release.yaml diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml new file mode 100644 index 0000000..899078d --- /dev/null +++ b/.gitea/workflows/main.yaml @@ -0,0 +1,49 @@ +name: Gitea Docker Build Demo +run-name: Reference Branch Build 🚀 +on: + push: + branches: + - main + +jobs: + Test: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.x' + - name: Test with the Go CLI + run: go test ./... + Build_Image: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up Cosign + uses: sigstore/cosign-installer@v3.10.0 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: remote + endpoint: tcp://buildkit-service.buildkit-service.svc:1234 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Build and Push the Docker Image + uses: docker/build-push-action@v6 + id: build-and-push + with: + context: . + file: ./Dockerfile + push: false + tags: | + lerentis/canada-kaktus:{{ github.sha }} + - name: Sign the published Docker image + env: + COSIGN_EXPERIMENTAL: "true" + run: cosign sign lerentis/canada-kaktus:${{ github.sha }}@${{ steps.build-and-push.outputs.digest }} \ No newline at end of file diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..df96bd9 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,46 @@ +name: Release +run-name: ${{ gitea.actor }} is Releasing a new version 🚀 +on: [release] + +jobs: + Test: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.x' + - name: Test with the Go CLI + run: go test ./... + Build_Image: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up Cosign + uses: sigstore/cosign-installer@v3.10.0 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: remote + endpoint: tcp://buildkit-service.buildkit-service.svc:1234 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Build and Push the Docker Image + uses: docker/build-push-action@v6 + id: build-and-push + with: + context: . + file: ./Dockerfile + push: true + tags: | + lerentis/canada-kaktus:{{ github.event.release.tag_name }} + - name: Sign the published Docker image + env: + COSIGN_EXPERIMENTAL: "true" + run: cosign sign lerentis/canada-kaktus:${{ github.event.release.tag_name }}@${{ steps.build-and-push.outputs.digest }} \ No newline at end of file diff --git a/.woodpecker/main.yaml b/.woodpecker/main.yaml deleted file mode 100644 index d4e420a..0000000 --- a/.woodpecker/main.yaml +++ /dev/null @@ -1,21 +0,0 @@ -when: - - event: push - branch: main - -steps: - test: - image: golang:1.24 - commands: - - go test ./... - pre-release: - image: woodpeckerci/plugin-docker-buildx - settings: - platforms: linux/arm64/v8,linux/amd64 - repo: lerentis/woodpecker-autoscaler - tags: - - latest - - ${CI_COMMIT_SHA} - password: - from_secret: docker_hub_password - username: - from_secret: docker_hub_username diff --git a/.woodpecker/pr.yaml b/.woodpecker/pr.yaml deleted file mode 100644 index b30d06d..0000000 --- a/.woodpecker/pr.yaml +++ /dev/null @@ -1,17 +0,0 @@ -when: - - event: pull_request - -steps: - test: - image: golang:1.24 - commands: - - go test ./... - pr-build: - image: woodpeckerci/plugin-docker-buildx - settings: - platforms: linux/arm64/v8 - repo: lerentis/woodpecker-autoscaler - tags: - - latest - - ${CI_COMMIT_SHA} - dry-run: true diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml deleted file mode 100644 index 712c11a..0000000 --- a/.woodpecker/release.yaml +++ /dev/null @@ -1,20 +0,0 @@ -when: - - event: tag - -steps: - test: - image: golang:1.24 - commands: - - go test ./... - release: - image: woodpeckerci/plugin-docker-buildx - settings: - platforms: linux/arm64/v8,linux/amd64 - repo: lerentis/woodpecker-autoscaler - tags: - - latest - - ${CI_COMMIT_TAG} - password: - from_secret: docker_hub_password - username: - from_secret: docker_hub_username