Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-larner committed Sep 30, 2024
1 parent 45ea2a2 commit e9a6cc5
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Build and Push Docker Image to GHCR on Release
name: Publish Docker Image

# Trigger the workflow when a new release is created
on:
release:
types: [published]
Expand All @@ -10,28 +9,27 @@ jobs:
runs-on: ubuntu-latest

steps:
# Check out the repository containing the Dockerfile and other necessary files
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Set up Docker Buildx for advanced build features like multi-platform builds
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Log in to GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Extract Docker metadata (tags, labels)
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/matthewlarner/inception-mqtt
# Build and push the Docker image to GHCR with the 'latest' and release tags
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/matthewlarner/inception-mqtt:latest
ghcr.io/matthewlarner/inception-mqtt:${{ github.event.release.tag_name }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/matthewlarner/inception-mqtt:latest
ghcr.io/matthewlarner/inception-mqtt:${{ github.event.release.tag_name }}

0 comments on commit e9a6cc5

Please sign in to comment.