From 1e76dca0a9a292128360ce765ca1b0499ba7df73 Mon Sep 17 00:00:00 2001 From: Melora Hugues Date: Sat, 10 Aug 2024 16:01:31 +0200 Subject: [PATCH] Chore: replace woodpecker with forgejo actions --- .../workflows/docker-build-push-master.yml | 21 +++++++ .forgejo/workflows/docker-build-push-tag.yml | 21 +++++++ .forgejo/workflows/docker-build.yml | 16 ++++++ .forgejo/workflows/go-test.yml | 16 ++++++ .woodpecker/deploy.yml | 57 ------------------- .woodpecker/test.yml | 13 ----- 6 files changed, 74 insertions(+), 70 deletions(-) create mode 100644 .forgejo/workflows/docker-build-push-master.yml create mode 100644 .forgejo/workflows/docker-build-push-tag.yml create mode 100644 .forgejo/workflows/docker-build.yml create mode 100644 .forgejo/workflows/go-test.yml delete mode 100644 .woodpecker/deploy.yml delete mode 100644 .woodpecker/test.yml diff --git a/.forgejo/workflows/docker-build-push-master.yml b/.forgejo/workflows/docker-build-push-master.yml new file mode 100644 index 0000000..d5a1e37 --- /dev/null +++ b/.forgejo/workflows/docker-build-push-master.yml @@ -0,0 +1,21 @@ +on: + push: + branches: + - "main" +jobs: + docker-build-push: + runs-on: cth-ubuntu-latest + steps: + - name: set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: login to repository + uses: docker/login-action@v3 + with: + registry: git.faercol.me + username: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: build and push image + uses: docker/build-push-action@v6 + with: + push: true + tags: git.faercol.me/polyculeconnect/polyculeconnect:latest diff --git a/.forgejo/workflows/docker-build-push-tag.yml b/.forgejo/workflows/docker-build-push-tag.yml new file mode 100644 index 0000000..fafa715 --- /dev/null +++ b/.forgejo/workflows/docker-build-push-tag.yml @@ -0,0 +1,21 @@ +on: + push: + tags: + - "**" +jobs: + docker-build-push: + runs-on: cth-ubuntu-latest + steps: + - name: set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: login to repository + uses: docker/login-action@v3 + with: + registry: git.faercol.me + username: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: build and push image + uses: docker/build-push-action@v6 + with: + push: true + tags: git.faercol.me/polyculeconnect/polyculeconnect:${{ gitea.ref_name }} diff --git a/.forgejo/workflows/docker-build.yml b/.forgejo/workflows/docker-build.yml new file mode 100644 index 0000000..51cd8d9 --- /dev/null +++ b/.forgejo/workflows/docker-build.yml @@ -0,0 +1,16 @@ +on: + push: + branches: + - "**" + - "!main" +jobs: + docker-build-only: + runs-on: cth-ubuntu-latest + steps: + - name: set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: build image (build only) + uses: docker/build-push-action@v6 + with: + push: false + tags: git.faercol.me/polyculeconnect/polyculeconnect diff --git a/.forgejo/workflows/go-test.yml b/.forgejo/workflows/go-test.yml new file mode 100644 index 0000000..45f4c09 --- /dev/null +++ b/.forgejo/workflows/go-test.yml @@ -0,0 +1,16 @@ +on: + push: + branches: + - "**" +jobs: + go-test: + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: Run unit tests + run: make -C polyculeconnect test + - name: Build go package + run: make -C polyculeconnect build diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml deleted file mode 100644 index 36f5034..0000000 --- a/.woodpecker/deploy.yml +++ /dev/null @@ -1,57 +0,0 @@ -steps: - docker-build-only: - image: woodpeckerci/plugin-docker-buildx - privileged: true - settings: - repo: git.faercol.me/polyculeconnect/polyculeconnect - tags: latest - dry_run: true - platforms: - - linux/amd64 - # - linux/arm64 - when: - - event: pull_request - - event: push - branch: - exclude: [main] - - docker-build-push: - image: woodpeckerci/plugin-docker-buildx - privileged: true - settings: - repo: git.faercol.me/polyculeconnect/polyculeconnect - registry: git.faercol.me - tags: latest - username: - from_secret: git_username - password: - from_secret: git_password - platforms: - - linux/amd64 - # - linux/arm64 - when: - - event: push - branch: main - - docker-push-tag: - image: woodpeckerci/plugin-docker-buildx - privileged: true - settings: - registry: git.faercol.me - repo: git.faercol.me/polyculeconnect/polyculeconnect - auto_tag: true - platforms: - - linux/amd64 - # - linux/arm64 - username: - from_secret: git_username - password: - from_secret: git_password - when: - - event: tag - -depends_on: - - test - -when: - event: [push, tag] diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml deleted file mode 100644 index be910ab..0000000 --- a/.woodpecker/test.yml +++ /dev/null @@ -1,13 +0,0 @@ -steps: - go-test: - image: golang - commands: - - make -C polyculeconnect test - - go-build: - image: golang - commands: - - make -C polyculeconnect build - -when: - event: [push, tag]