From 395be4db9e5c7527e8121ba4f9f21855652a2ab6 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Thu, 8 May 2025 12:07:07 +0200 Subject: [PATCH] fix(ci): replace drone with gitea actions --- .gitea/workflows/build.yaml | 45 +++++++++++ .gitea/workflows/release.yaml | 76 +++++++++++++++++++ .../update-docker-hub-description.yaml | 21 +++++ README.md | 3 +- 4 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/build.yaml create mode 100644 .gitea/workflows/release.yaml create mode 100644 .gitea/workflows/update-docker-hub-description.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..01f9e5a --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,45 @@ +name: Build + +on: + pull_request: + types: + - "opened" + - "reopened" + - "synchronize" + push: + branches: + - master + workflow_dispatch: {} + +jobs: + build-arch-linux: + runs-on: ubuntu-latest-amd64 + steps: + - uses: actions/checkout@v4.2.2 + - uses: docker/setup-qemu-action@v3.6.0 + - uses: docker/setup-buildx-action@v3.10.0 + + - name: Build image + run: | + TAG=latest + + docker buildx build \ + --file Dockerfile.archlinux \ + --tag git.cryptic.systems/volker.raschek/ansible:${TAG}-archlinux \ + . + + build-rocky-linux-8: + runs-on: ubuntu-latest-amd64 + steps: + - uses: actions/checkout@v4.2.2 + - uses: docker/setup-qemu-action@v3.6.0 + - uses: docker/setup-buildx-action@v3.10.0 + + - name: Build image + run: | + TAG=latest + + docker buildx build \ + --file Dockerfile.rockylinux8 \ + --tag git.cryptic.systems/volker.raschek/ansible:${TAG}-rockylinux-8 \ + . diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..922b246 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,76 @@ +name: Release + +on: + push: + tags: + - "**" + +jobs: + push-arch-linux: + runs-on: ubuntu-latest-amd64 + steps: + - uses: actions/checkout@v4.2.2 + - uses: docker/setup-qemu-action@v3.6.0 + - uses: docker/setup-buildx-action@v3.10.0 + + - uses: docker/login-action@v3.4.0 + with: + registry: git.cryptic.systems + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} + + - name: Build image + run: | + TAG=latest + + docker buildx build \ + --file Dockerfile.archlinux \ + --push \ + --tag git.cryptic.systems/volker.raschek/ansible:${TAG}-archlinux \ + . + + push-rocky-linux-8: + runs-on: ubuntu-latest-amd64 + steps: + - uses: actions/checkout@v4.2.2 + - uses: docker/setup-qemu-action@v3.6.0 + - uses: docker/setup-buildx-action@v3.10.0 + + - uses: docker/login-action@v3.4.0 + with: + registry: git.cryptic.systems + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} + + - name: Build image + run: | + TAG=latest + + docker buildx build \ + --file Dockerfile \ + --push \ + --tag git.cryptic.systems/volker.raschek/ansible:${TAG}-rockylinux-8 \ + . + + sync-to-hub-docker-io: + needs: + - push-manifest + runs-on: ubuntu-latest + steps: + - name: Copy images to docker.io + run: | + TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm') + + apt-get update --yes + apt-get install --yes skopeo + + for suffix in archlinux rockylinux-8; do + skopeo copy \ + --all \ + --dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \ + --dest-username ${{ secrets.DOCKER_IO_USERNAME }} \ + --src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \ + --src-username volker.raschek \ + docker://git.cryptic.systems/volker.raschek/ansible:${TAG}-${suffix} \ + docker://docker.io/volkerraschek/ansible:${TAG}-${suffix} + done \ No newline at end of file diff --git a/.gitea/workflows/update-docker-hub-description.yaml b/.gitea/workflows/update-docker-hub-description.yaml new file mode 100644 index 0000000..60e1481 --- /dev/null +++ b/.gitea/workflows/update-docker-hub-description.yaml @@ -0,0 +1,21 @@ +name: Update Docker Hub Description + +on: + push: + branches: + - master + paths: + - README.md + +jobs: + update-description-on-hub-docker-io: + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + - uses: peter-evans/dockerhub-description@v4.0.2 + with: + username: ${{ secrets.DOCKER_IO_USERNAME }} + password: ${{ secrets.DOCKER_IO_PASSWORD }} + repository: volkerraschek/ansible + readme-filepath: README.md \ No newline at end of file diff --git a/README.md b/README.md index 3c7b44e..f7db48c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -# ansible-archlinux-docker +# ansible -[![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/ansible-archlinux-docker/status.svg)](https://drone.cryptic.systems/volker.raschek/ansible-archlinux-docker) [![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/ansible-archlinux)](https://hub.docker.com/r/volkerraschek/ansible-archlinux)