Skip to content

Commit

Permalink
Build docker image (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
invliD authored Feb 20, 2024
1 parent 8ff1fee commit 4b4335b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,42 @@ jobs:
run: test -z $(gofmt -l .) || (gofmt -d . && exit 1)
- uses: actions/upload-artifact@v4
with:
name: binary
path: mdns2mqtt
if-no-files-found: error
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and load
uses: docker/build-push-action@v5
with:
context: .
outputs: type=docker,dest=/tmp/image.tar
tags: invlid/mdns2mqtt:latest
- uses: actions/upload-artifact@v4
with:
name: docker-image
path: /tmp/image.tar
if-no-files-found: error
publish:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docker-image
path: /tmp
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Load image
run: |
docker load --input /tmp/image.tar
- name: Push image
run: |
docker push invlid/mdns2mqtt:latest
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch

COPY mdns2mqtt /
CMD ["/mdns2mqtt"]

0 comments on commit 4b4335b

Please sign in to comment.