-
Notifications
You must be signed in to change notification settings - Fork 48
100 lines (82 loc) · 2.75 KB
/
build_branch.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build branch
on:
push:
branches:
- "*/**"
paths-ignore:
- ".github/workflows/publish*.yaml"
- "*.md"
concurrency:
group: build-branch-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_REPOSITORY: timescale/timescaledb-ha
DOCKER_REGISTRY: docker.io
PG_MAJOR: 16
ALL_VERSIONS: "true"
OSS_ONLY: "false"
jobs:
build-branch:
name: Build and push branch
runs-on: ${{ matrix.runs_on }}
strategy:
fail-fast: false
matrix:
platform: [ amd64, arm64 ]
include:
- platform: amd64
runs_on: ubuntu-22.04
- platform: arm64
runs_on: cloud-image-runner-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install docker (arm64 beta)
if: matrix.platform == 'arm64'
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl acl build-essential
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.ORG_DOCKER_HUB_USERNAME }}
password: ${{ secrets.ORG_DOCKER_HUB_ACCESS_TOKEN }}
- name: Setup | Buildx
uses: docker/setup-buildx-action@v3
- name: Build
env:
PLATFORM: ${{ matrix.platform }}
run: make build-sha
- name: Check
env:
PLATFORM: ${{ matrix.platform }}
run: make check-sha
- name: Publish
env:
PLATFORM: ${{ matrix.platform }}
run: make publish-sha
publish-combined-manifest:
name: Publish branch manifest
needs: [ "build-branch" ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.ORG_DOCKER_HUB_USERNAME }}
password: ${{ secrets.ORG_DOCKER_HUB_ACCESS_TOKEN }}
- name: Publish combined manifest for branch
run: make publish-combined-sha