Skip to content

Commit

Permalink
fix: Update cd.yml workflow to include Docker image publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
MountainGod2 committed Nov 6, 2024
1 parent ec63300 commit de587a6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,53 @@ 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 }}
10 changes: 5 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit de587a6

Please sign in to comment.