Skip to content

Commit 680b1a4

Browse files
authored
[skip ci] Build & push to DockerHub w/ GH Actions
1 parent 315e632 commit 680b1a4

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/dockerhub.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: DockerHub
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
- stable
9+
tags:
10+
- 'v*.*.*'
11+
12+
jobs:
13+
multiarch-build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Get Docker tags
23+
id: docker_meta
24+
uses: crazy-max/ghaction-docker-meta@v1
25+
with:
26+
images: jrcs/letsencrypt-nginx-proxy-companion
27+
tag-semver: |
28+
{{version}}
29+
{{major}}.{{minor}}
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v1
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v1
36+
37+
- name: Login to DockerHub
38+
uses: docker/login-action@v1
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: Retrieve version
44+
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
45+
46+
- name: Build and push
47+
id: docker_build
48+
uses: docker/build-push-action@v2
49+
with:
50+
build-args: GIT_DESCRIBE=${{ env.GIT_DESCRIBE }}
51+
platforms: linux/amd64,linux/arm64,linux/arm/v7
52+
push: true
53+
tags: |
54+
${{ github.ref != 'refs/heads/master' && steps.docker_meta.outputs.tags || '' }}
55+
${{ github.ref == 'refs/heads/master' && 'jrcs/letsencrypt-nginx-proxy-companion:latest' || '' }}
56+
labels: ${{ steps.docker_meta.outputs.labels }}
57+
58+
- name: Image digest
59+
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)