diff --git a/.gitea/workflows/auto-release.yaml b/.gitea/workflows/auto-release.yaml index 0922bf0..39cf37e 100644 --- a/.gitea/workflows/auto-release.yaml +++ b/.gitea/workflows/auto-release.yaml @@ -1,4 +1,4 @@ -name: Auto release +name: Auto release tagged on: push: @@ -58,7 +58,7 @@ jobs: uses: actions/github-script@v9.0.0 with: script: | - const workflowFileName = 'release.yaml'; + const workflowFileName = 'release-tagged.yaml'; const defaultBranch = context.payload.repository.default_branch; const definedTag = '${{ steps.create_tag.outputs.defined_tag }}'; diff --git a/.gitea/workflows/release-latest.yaml b/.gitea/workflows/release-latest.yaml new file mode 100644 index 0000000..51b7eaf --- /dev/null +++ b/.gitea/workflows/release-latest.yaml @@ -0,0 +1,92 @@ +name: Release latest + +on: + push: + branches: [ "master" ] + +jobs: + push-arm64: + runs-on: ubuntu-latest-arm64 + steps: + - uses: actions/checkout@v6.0.2 + + - uses: docker/setup-qemu-action@v4.1.0 + - uses: docker/setup-buildx-action@v4.1.0 + + - uses: docker/login-action@v4.2.0 + with: + registry: git.cryptic.systems + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} + + - name: Build and push image + run: | + docker buildx build \ + --file Dockerfile \ + --platform linux/arm64 \ + --provenance false \ + --push \ + --tag git.cryptic.systems/volker.raschek/docker-compose:latest-arm64 \ + . + + push-amd64: + runs-on: ubuntu-latest-amd64 + steps: + - uses: actions/checkout@v6.0.2 + + - uses: docker/setup-qemu-action@v4.1.0 + - uses: docker/setup-buildx-action@v4.1.0 + + - uses: docker/login-action@v4.2.0 + with: + registry: git.cryptic.systems + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} + + - name: Build and push image + run: | + docker buildx build \ + --file Dockerfile \ + --platform linux/amd64 \ + --provenance false \ + --push \ + --tag git.cryptic.systems/volker.raschek/docker-compose:latest-amd64 \ + . + + push-manifest: + runs-on: ubuntu-latest + needs: + - push-arm64 + - push-amd64 + steps: + - uses: docker/login-action@v4.2.0 + with: + registry: git.cryptic.systems + username: ${{ github.repository_owner }} + password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} + + - name: Create and push manifest + run: | + docker manifest create git.cryptic.systems/volker.raschek/docker-compose:latest \ + --amend git.cryptic.systems/volker.raschek/docker-compose:latest-amd64 \ + --amend git.cryptic.systems/volker.raschek/docker-compose:latest-arm64 + + docker manifest push git.cryptic.systems/volker.raschek/docker-compose:latest + + sync-to-hub-docker-io: + needs: + - push-manifest + runs-on: ubuntu-latest + steps: + - name: Copy images to docker.io + run: | + apt-get update --yes + apt-get install --yes skopeo + 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/docker-compose:latest \ + docker://docker.io/volkerraschek/docker-compose:latest diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release-tagged.yaml similarity index 99% rename from .gitea/workflows/release.yaml rename to .gitea/workflows/release-tagged.yaml index 0ac7934..ba6aae7 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release-tagged.yaml @@ -1,4 +1,4 @@ -name: Release +name: Release tagged on: push: