-
-
Notifications
You must be signed in to change notification settings - Fork 193
43 lines (41 loc) · 1.5 KB
/
docker-main.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
name: Docker Main Build
on:
push:
branches: [ main ]
jobs:
docker-main-build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
with:
version: v0.14.1
driver-opts: |
image=moby/buildkit:buildx-stable-1
network=host
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/[email protected]
with:
# NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/hairyhenderson/gomplate/settings
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & Push (latest tag)
run: |
export srcrepo=${{ github.repository}}
make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=${srcrepo} BUILDX_ACTION=--push
docker buildx imagetools create -t gomplate/gomplate:latest ${srcrepo}:latest
docker buildx imagetools create -t gomplate/gomplate:alpine ${srcrepo}:alpine
docker buildx imagetools create -t ghcr.io/${srcrepo}:latest ${srcrepo}:latest
docker buildx imagetools create -t ghcr.io/${srcrepo}:alpine ${srcrepo}:alpine