-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (51 loc) · 1.93 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
env:
IMAGE_NAME: image
jobs:
# Push image to GitHub Package Registry.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: |
docker build . --file src/waka-go-proxy/Dockerfile --tag proxy
docker build . --file src/waka-orchestrator/Dockerfile --tag orchestrator
docker build . --file src/waka-realtime/Dockerfile --tag realtime
docker build . --file src/waka-worker/Dockerfile --tag worker
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}
SHA=$(git rev-parse HEAD)
echo IMAGE_ID=$IMAGE_ID
echo SHA=$SHA
docker tag proxy $IMAGE_ID/proxy:latest
docker tag proxy $IMAGE_ID/proxy:$SHA
docker push $IMAGE_ID/proxy:latest
docker push $IMAGE_ID/proxy:$SHA
docker tag orchestrator $IMAGE_ID/orchestrator:latest
docker tag orchestrator $IMAGE_ID/orchestrator:$SHA
docker push $IMAGE_ID/orchestrator:latest
docker push $IMAGE_ID/orchestrator:$SHA
docker tag realtime $IMAGE_ID/realtime:latest
docker tag realtime $IMAGE_ID/realtime:$SHA
docker push $IMAGE_ID/realtime:latest
docker push $IMAGE_ID/realtime:$SHA
docker tag worker $IMAGE_ID/worker:latest
docker tag worker $IMAGE_ID/worker:$SHA
docker push $IMAGE_ID/worker:latest
docker push $IMAGE_ID/worker:$SHA