-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (68 loc) · 2.11 KB
/
publish-images.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
name: Build and publish images
on:
workflow_dispatch:
release:
types: [published]
env:
IMAGE_REF_NAME: ${{ github.event_name == 'release' && 'robothub-app-v2' || 'robothub-app-v2-dev' }}
jobs:
generate-version:
name: Generate image version
runs-on: buildjet-2vcpu-ubuntu-2204
outputs:
version: ${{ steps.generate-version.outputs.version }}
steps:
- name: Generate image version
id: generate-version
run: echo "version=$(date +%Y.%j.%H%M)" >> "$GITHUB_OUTPUT"
build:
name: Build & push images
permissions:
packages: write
contents: read
needs: generate-version
strategy:
fail-fast: false
matrix:
runner:
- { runs-on: buildjet-4vcpu-ubuntu-2204, arch: amd64 }
- { runs-on: buildjet-4vcpu-ubuntu-2204-arm, arch: arm64 }
env:
IMAGE_VERSION: ${{ needs.generate-version.outputs.version }}
ARCH: ${{ matrix.runner.arch }}
runs-on: ${{ matrix.runner.runs-on }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push images
run: ./scripts/build-images.sh
make-manifests:
name: Make multi-arch manifests
permissions:
packages: write
contents: read
needs: [generate-version, build]
env:
IMAGE_VERSION: ${{ needs.generate-version.outputs.version }}
runs-on: buildjet-2vcpu-ubuntu-2204
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Make multi-arch manifests
run: ./scripts/make-manifests.sh