From 413521b21a39c45e9d4b542efa0baf7895762a78 Mon Sep 17 00:00:00 2001 From: thehack904 <35552907+thehack904@users.noreply.github.com> Date: Sat, 11 Oct 2025 07:23:52 -0500 Subject: [PATCH] Create docker-publish.yml Add GHCR publish workflow --- .github/workflows/docker-publish.yml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..a42b8b1 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,52 @@ +name: ๐Ÿš€ Build and Publish RetroIPTVGuide to GHCR + +on: + push: + branches: [ main ] + tags: + - 'v*' + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: ๐Ÿงพ Checkout repository + uses: actions/checkout@v4 + + - name: ๐Ÿ”‘ Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: ๐Ÿ—๏ธ Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: ๐Ÿงฑ Build and Push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} + platforms: linux/amd64,linux/arm64 + labels: | + org.opencontainers.image.source=${{ github.repositoryUrl }} + org.opencontainers.image.description=RetroIPTVGuide Flask + SQLite Web App + org.opencontainers.image.licenses=CC-BY-NC-SA-4.0 + + - name: ๐Ÿงน Cleanup local images (optional) + run: docker image prune -af || true