-
Notifications
You must be signed in to change notification settings - Fork 97
100 lines (88 loc) · 3.14 KB
/
release_local_dashboard.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
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: Release Self-Hosted Dashboard
on:
workflow_dispatch:
inputs:
tag_latest:
description: 'Tag image as latest'
type: boolean
default: false
required: true
permissions:
contents: read
packages: write
id-token: write
jobs:
build:
name: Build dashboard image
strategy:
matrix:
arch: [x64, arm64]
runs-on: [self-hosted, aws, "${{ matrix.arch }}", xlarge]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push dashboard
uses: docker/build-push-action@v6
id: build-image
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
file: self-hosted/Dockerfile.dashboard
tags: |
ghcr.io/get-convex/self-hosted-dashboard
cache-from: type=gha,mode=max
cache-to: type=gha,mode=max
outputs: push-by-digest=true,type=image,push=true
provenance: false
- name: Write digest
uses: cloudposse/github-action-matrix-outputs-write@v1
id: digest
with:
matrix-step-name: ${{ github.job }}
matrix-key: ${{ matrix.arch }}
outputs: |-
digest: ${{ steps.build-image.outputs.digest }}
read:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: build
outputs:
result: "${{ steps.read.outputs.result }}"
push:
name: Push merged image manifest
needs: [read]
runs-on: [self-hosted, aws, x64, medium]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Push manifest
run: |
docker manifest create ghcr.io/get-convex/self-hosted-dashboard:${{ github.sha }} \
--amend ghcr.io/get-convex/self-hosted-dashboard@${{ fromJson(needs.read.outputs.result).digest.x64 }} \
--amend ghcr.io/get-convex/self-hosted-dashboard@${{ fromJson(needs.read.outputs.result).digest.arm64 }}
docker manifest push ghcr.io/get-convex/self-hosted-dashboard:${{ github.sha }}
if [[ "${{ github.event.inputs.tag_latest }}" == "true" ]]; then
docker manifest create ghcr.io/get-convex/self-hosted-dashboard:latest \
--amend ghcr.io/get-convex/self-hosted-dashboard@${{ fromJson(needs.read.outputs.result).digest.x64 }} \
--amend ghcr.io/get-convex/self-hosted-dashboard@${{ fromJson(needs.read.outputs.result).digest.arm64 }}
docker manifest push ghcr.io/get-convex/self-hosted-dashboard:latest
fi