From 7d84ae66deccb40c70a7f583a6a2de0633cbbc57 Mon Sep 17 00:00:00 2001 From: DominicJamesWhite Date: Thu, 10 Apr 2025 12:53:37 +0200 Subject: [PATCH] Add image action --- .github/workflows/build-push.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build-push.yml diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml new file mode 100644 index 000000000..aec7783a5 --- /dev/null +++ b/.github/workflows/build-push.yml @@ -0,0 +1,38 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +permissions: + contents: read + packages: write + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/dominicjameswhite/canyonchat + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}