Modified github action to build rpi images #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: prod-to-dockerhub | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.PTDH_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.PTDH_DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: hyperprog/hassesdaemon | |
tags: | | |
type=raw,value=latest | |
labels: | | |
org.opencontainers.image.title=Hasses Daemon | |
org.opencontainers.image.description=Multi-platform support for Raspberry Pi and PC | |
org.opencontainers.image.vendor=HyperProg | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Docker/Dockerfile | |
push: true | |
platforms: | | |
linux/amd64, | |
linux/arm/v6, | |
linux/arm/v7, | |
linux/arm64/v8 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |