acme.sh/.github/workflows/dockerhub.yml

38 lines
1.1 KiB
YAML
Raw Normal View History

2020-05-01 15:44:56 +00:00
name: Build DockerHub
on:
push:
2020-08-21 08:54:24 +00:00
branches:
- master
- dev
- temp
tags:
- '*'
2020-05-01 15:44:56 +00:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2020-07-23 12:53:53 +00:00
- name: checkout code
uses: actions/checkout@v2
- name: install buildx
id: buildx
2020-08-21 08:54:24 +00:00
uses: crazy-max/ghaction-docker-buildx@v3
2020-07-23 12:53:53 +00:00
with:
2020-08-21 08:54:24 +00:00
buildx-version: latest
qemu-version: latest
2020-07-23 12:53:53 +00:00
- name: login to docker hub
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
2020-08-21 08:54:24 +00:00
- name: build and push the image
run: |
2020-08-21 08:54:24 +00:00
DOCKER_IMAGE_TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/^master$/latest/')
[ "$DOCKER_IMAGE" == "latest" ] && AUTO_UPGRADE="1" || AUTO_UPGRADE=""
docker buildx build \
2020-08-21 08:54:24 +00:00
--output "type=image,push=true" \
--tag ei99070/acme.sh:${DOCKER_IMAGE_TAG} \
--tag ei99070/acme.sh:${GITHUB_SHA} \
--build-arg AUTO_UPGRADE=${AUTO_UPGRADE} \
--platform linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/386 .