-
Notifications
You must be signed in to change notification settings - Fork 84
49 lines (44 loc) · 1.29 KB
/
docker.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
name: Docker
on:
push:
branches: ["main"]
tags: ["v*"]
env:
PLATFORMS: "linux/amd64,linux/arm64"
jobs:
build:
name: Build and publish images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
with:
platforms: ${{ env.PLATFORMS }}
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build main Sydent image
if: github.ref_name == 'main'
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
matrixdotorg/sydent:main
- name: Build release Sydent image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
matrixdotorg/sydent:latest
matrixdotorg/sydent:${{ github.ref_name }}