-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split GitHub actions to multiple platforms
- Loading branch information
1 parent
bbad8a1
commit 00087ed
Showing
2 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: ARM Image Build | ||
on: | ||
push: | ||
branches: [ master ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_REGISTRY: hub.docker.com | ||
DOCKER_IMAGE: philhawthorne/ha-dockermon | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_TARGET_PLATFORM: linux/arm/v7,linux/arm64 | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v1 | ||
- name: Set up Docker Buildx | ||
uses: crazy-max/ghaction-docker-buildx@v1 | ||
with: | ||
version: latest | ||
- name: Prepare | ||
if: success() | ||
id: prepare | ||
run: | | ||
echo "docker_platform=${DOCKER_TARGET_PLATFORM}" >> "$GITHUB_OUTPUT" | ||
echo "docker_image=philhawthorne/ha-dockermon" >> "$GITHUB_OUTPUT" | ||
echo "version=${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT" | ||
- name: Docker Login | ||
if: success() | ||
run: | | ||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | ||
- name: Push arm-tag | ||
if: success() | ||
run: | | ||
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:arm --file ./Dockerfile.RaspberryPi --output type=image,push=true . | ||
- name: Push arm-latest tag | ||
if: success() | ||
run: | | ||
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:arm-latest --file ./Dockerfile.RaspberryPi --output type=image,push=true . |
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