-
-
Notifications
You must be signed in to change notification settings - Fork 201
87 lines (71 loc) · 2.16 KB
/
build-preview-docker-image.yml
File metadata and controls
87 lines (71 loc) · 2.16 KB
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
name: Build and Push Preview Docker Image
permissions:
contents: read
packages: write
concurrency:
group: docker-ci-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
env:
GO_VERSION: "1.25"
NODE_VERSION: "24"
jobs:
docker:
name: Build Docker Image
runs-on: ubuntu-latest
# Only run if the triggering CI workflow concluded successfully
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code (commit from CI run)
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: ui/pnpm-lock.yaml
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
check-latest: true
- name: Install deps
run: make deps
- name: Generate tags
id: tags
run: |
echo "tags=ghcr.io/${{ github.repository_owner }}/kite:main" >> $GITHUB_OUTPUT
echo "image_tag=main" >> $GITHUB_OUTPUT
- name: Build
run: make cross-compile
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.binary
push: true
tags: ${{ steps.tags.outputs.tags }}
labels: runnumber=${{ github.run_id }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64