From 490af4e18d0bca9c4ceafd4624123288c52b57cb Mon Sep 17 00:00:00 2001 From: MountainGod2 Date: Tue, 5 Nov 2024 18:15:56 -0700 Subject: [PATCH] fix: Remove unnecessary Docker image publishing steps in cd.yml workflow --- .github/workflows/cd.yml | 50 ------------------------------ .github/workflows/docker-build.yml | 30 ++++++------------ 2 files changed, 10 insertions(+), 70 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c11454c9..db25d5e5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -67,53 +67,3 @@ jobs: uses: python-semantic-release/publish-action@v9 with: github_token: ${{ secrets.GH_PAT }} - - - name: Publish | Docker Meta - if: steps.release.outputs.released == 'true' - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/mountaingod2/chaturbate_poller - docker.io/mountaingod2/chaturbate_poller - tags: | - type=schedule,pattern=nightly - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - - name: Publish | Set up QEMU - if: steps.release.outputs.released == 'true' - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - if: steps.release.outputs.released == 'true' - uses: docker/setup-buildx-action@v3 - - - name: Publish | Login to Docker Hub - if: steps.release.outputs.released == 'true' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Publish | Login to GHCR - if: steps.release.outputs.released == 'true' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish | Build and Push Docker Image - if: steps.release.outputs.released == 'true' - uses: docker/build-push-action@v6 - with: - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 - annotations: ${{ steps.meta.outputs.annotations }} diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 7fb474fc..3aff13cb 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -2,11 +2,11 @@ name: Docker Build on: workflow_dispatch: - # schedule: - # - cron: "0 10 * * *" - # push: - # tags: - # - "v*.*.*" + schedule: + - cron: "0 10 * * *" + push: + tags: + - "v*.*.*" jobs: docker: @@ -21,19 +21,19 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker Meta id: meta uses: docker/metadata-action@v5 with: images: | - ghcr.io/mountaingod2/chaturbate_poller - docker.io/mountaingod2/chaturbate_poller + ghcr.io/${{ github.repository_owner }}/chaturbate_poller + docker.io/${{ github.repository_owner }}/chaturbate_poller tags: | type=schedule,pattern=nightly type=ref,event=branch - type=ref,event=pr + type=ref,event=tag type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} @@ -46,13 +46,7 @@ jobs: uses: docker/setup-buildx-action@v3 with: install: true - driver-opts: network=host - driver: docker-container - - - name: Create and Use Builder - run: | - docker buildx create --use --name mybuilder - docker buildx inspect mybuilder --bootstrap + driver-opts: image=moby/buildkit:latest - name: Login to Docker Hub uses: docker/login-action@v3 @@ -75,7 +69,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 annotations: ${{ steps.meta.outputs.annotations }} - - - name: Clean up Buildx - if: always() - run: docker buildx rm mybuilder || true