-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.67 KB
/
docker-publish-arm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Docker-arm32
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: ups-influxdb-writer-arm32
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platforms::linux/arm/v6,linux/arm/v7
echo ::set-output name=docker_username::drakeapps
echo ::set-output name=docker_image::docker.io/drakeapps/ups-influxdb-writer
echo ::set-output name=version::${GITHUB_REF#refs/*/}
echo ::set-output name=hash::${GITHUB_SHA}
- name: Set up buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: Docker Login
if: success()
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login docker.io -u ${{ github.actor }} --password-stdin
- name: Run Buildx (master)
if: success() && contains(steps.prepare.outputs.version, 'master')
run: |
docker buildx build \
--output type=image,name=${{ steps.prepare.outputs.docker_image }},push=true \
--platform ${{ steps.prepare.outputs.docker_platforms }} \
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \
--file Dockerfile.arm32 .