-
Notifications
You must be signed in to change notification settings - Fork 794
69 lines (60 loc) · 2.07 KB
/
build_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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: build
on:
push:
branches:
- master
jobs:
docker_images:
name: docker images
runs-on: ubuntu-latest
strategy:
matrix:
image: [gorse-master, gorse-server, gorse-worker, gorse-in-one]
steps:
- name: Pull source
uses: actions/checkout@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build docker image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
file: cmd/${{ matrix.image }}/Dockerfile
push: true
tags: zhenghaoz/${{ matrix.image }}:nightly
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Resolve Images on Description
run: |
sed -i -E "s/src=\"assets\//src=\"https:\/\/github.com\/gorse-io\/gorse\/raw\/master\/assets\//" README.md
- name: Update DockerHub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: zhenghaoz/${{ matrix.image }}
windows_images:
name: windows images
runs-on: windows-latest
strategy:
matrix:
image: [gorse-master, gorse-server, gorse-worker, gorse-in-one]
steps:
- name: Pull source
uses: actions/checkout@v1
- name: Build docker image
run: |
docker login -u $env:DOCKERHUB_USERNAME -p $env:DOCKERHUB_TOKEN
docker build -f cmd/${{ matrix.image }}/Dockerfile.windows `
-t zhenghaoz/${{ matrix.image }}:nightly-windowsservercore .
docker image push --all-tags zhenghaoz/${{ matrix.image }}
docker logout
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}