From ce80b046fb016ecbdee6792cf94f27d37e62e9ce Mon Sep 17 00:00:00 2001 From: MrMeeb Date: Sun, 4 Aug 2024 17:13:58 +0000 Subject: [PATCH] Add Gitea Actions (#7) Reviewed-on: https://git.mrmeeb.stream/MrMeeb/postfix-docker/pulls/7 --- .drone.yml | 40 ------------------------ .gitea/workflows/build-main.yaml | 52 ++++++++++++++++++++++++++++++++ .gitea/workflows/test-pr.yaml | 46 ++++++++++++++++++++++++++++ README.md | 2 -- 4 files changed, 98 insertions(+), 42 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/build-main.yaml create mode 100644 .gitea/workflows/test-pr.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 4d80c77..0000000 --- a/.drone.yml +++ /dev/null @@ -1,40 +0,0 @@ -kind: pipeline -type: docker -name: build-multiarch-images - -platform: - os: linux - arch: amd64 - -steps: -- name: make-tags - image: node - commands: - - echo -n "${DRONE_COMMIT_SHA:0:10}, latest" > .tags - -- name: build - image: thegeeklab/drone-docker-buildx - privileged: true - settings: - registry: git.mrmeeb.stream - username: - from_secret: docker_username - password: - from_secret: docker_password - repo: git.mrmeeb.stream/mrmeeb/postfix - platforms: - - linux/arm64 - - linux/amd64 - -- name: notify - image: plugins/slack - settings: - webhook: - from_secret: slack_webhook - -trigger: - branch: - - master - event: - exclude: - - pull_request \ No newline at end of file diff --git a/.gitea/workflows/build-main.yaml b/.gitea/workflows/build-main.yaml new file mode 100644 index 0000000..c7e3385 --- /dev/null +++ b/.gitea/workflows/build-main.yaml @@ -0,0 +1,52 @@ +name: Build Main Image +on: + push: + branches: + - 'master' + +env: + FULL_TAG: git.mrmeeb.stream/mrmeeb/postfix:latest + +jobs: + "Build Image": + runs-on: [ubuntu-docker-latest, linux/amd64] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.mrmeeb.stream + username: ${{ env.GITHUB_ACTOR }} + password: ${{ secrets.GTCR_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ env.FULL_TAG }} + provenance: false + - name: Notify on failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Build failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} + "Notify": + runs-on: [ubuntu-docker-latest, linux/amd64] + needs: ["Build Image"] + steps: + - name: Notify of success + uses: rjstone/discord-webhook-notify@v1 + if: success() + with: + severity: info + details: Build succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} \ No newline at end of file diff --git a/.gitea/workflows/test-pr.yaml b/.gitea/workflows/test-pr.yaml new file mode 100644 index 0000000..80b54d9 --- /dev/null +++ b/.gitea/workflows/test-pr.yaml @@ -0,0 +1,46 @@ +name: Test Pull Request +on: + pull_request: + branches: + - 'master' + +env: + FULL_TAG: git.mrmeeb.stream/mrmeeb/postfix:develop + +jobs: + "Build Image": + runs-on: [ubuntu-docker-latest, linux/amd64] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build + uses: docker/build-push-action@v5 + with: + push: false + platforms: linux/amd64,linux/arm64 + tags: ${{ env.FULL_TAG }} + provenance: false + - name: Notify on failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Build failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} + "Notify": + runs-on: [ubuntu-docker-latest, linux/amd64] + needs: ["Build Image"] + steps: + - name: Notify of success + uses: rjstone/discord-webhook-notify@v1 + if: success() + with: + severity: info + details: Build succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} \ No newline at end of file diff --git a/README.md b/README.md index a36fcdf..76050bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ # Postfix Docker -[![Build Status](https://drone.mrmeeb.stream/api/badges/MrMeeb/postfix-docker/status.svg)](https://drone.mrmeeb.stream/MrMeeb/postfix-docker) - Dockerised Postfix for fully-dockerised SimpleLogin deployment \ No newline at end of file