From 30045c696e670cb161baf35f18048e8af512336a Mon Sep 17 00:00:00 2001 From: Nate Emmert Date: Mon, 16 Mar 2026 12:38:43 -0400 Subject: [PATCH] Add container publish workflow --- .github/workflows/publish-container.yml | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/publish-container.yml diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml new file mode 100644 index 0000000..102bb7c --- /dev/null +++ b/.github/workflows/publish-container.yml @@ -0,0 +1,47 @@ +name: Publish Container + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract image metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/nmemmert/weather + tags: | + type=raw,value=latest + type=sha + + - name: Build and push image + uses: docker/build-push-action@v6 + with: + context: ./app + file: ./app/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file