Skip to content

Commit

Permalink
Publish to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
mihai-dinculescu committed Nov 13, 2023
1 parent 0af2589 commit 46a1751
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
checks:
name: Rust checks
Expand All @@ -25,3 +31,38 @@ jobs:
run: cargo make clippy
- name: Run test
run: cargo make test
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ RUN apt-get update && \

WORKDIR /app
COPY --from=builder /app/target/release/home-automation-tapo home-automation-tapo
COPY settings.yaml settings.yaml
COPY settings.sample.yaml settings.yaml

ENTRYPOINT ["/app/home-automation-tapo"]
2 changes: 1 addition & 1 deletion Dockerfile-ARMv7.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ RUN apt-get update && \

WORKDIR /app
COPY --from=builder /app/target/release/home-automation-tapo home-automation-tapo
COPY settings.yaml settings.yaml
COPY settings.sample.yaml settings.yaml

ENTRYPOINT ["/app/home-automation-tapo"]

0 comments on commit 46a1751

Please sign in to comment.