-
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 1.93 KB
/
image.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
70
71
72
73
74
on:
pull_request:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN"
env:
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
- run: docker buildx create --driver docker-container --use
- name: build
run: |
set -euxo pipefail
if [ ${{ github.event_name }} = 'push' ]; then
args=(
--tag ghcr.io/getsentry/taskbroker:latest
--tag ghcr.io/getsentry/taskbroker:amd64-latest
--push
)
else
args=()
fi
docker buildx build \
--pull \
--platform linux/amd64 \
--cache-from ghcr.io/getsentry/taskbroker:latest \
--cache-to type=inline \
--tag ghcr.io/getsentry/taskbroker:${{ github.sha }} \
"${args[@]}" \
.
build-taskworker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN"
env:
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
- run: docker buildx create --driver docker-container --use
- name: build
run: |
set -euxo pipefail
if [ ${{ github.event_name }} = 'push' ]; then
args=(
--tag ghcr.io/getsentry/taskworker:latest
--tag ghcr.io/getsentry/taskworker:amd64-latest
--push
)
else
args=()
fi
docker buildx build \
--pull \
--platform linux/amd64 \
--cache-from ghcr.io/getsentry/taskworker:latest \
--cache-to type=inline \
--tag ghcr.io/getsentry/taskworker:${{ github.sha }} \
"${args[@]}" \
./python