forked from PasarGuard/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (105 loc) · 3.24 KB
/
Copy pathbuild-dev.yml
File metadata and controls
122 lines (105 loc) · 3.24 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build-Docker-dev
on:
push:
branches:
- "dev"
- "next"
env:
IMAGE: pasarguard/${{ github.event.repository.name }}:${{ github.ref_name }}
GHCR_IMAGE: ghcr.io/pasarguard/${{ github.event.repository.name }}:${{ github.ref_name }}
jobs:
build-dashboard:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
working-directory: ./dashboard
run: bun install --frozen-lockfile
- name: Build dashboard
run: ./build_dashboard.sh
- name: Upload dashboard build
uses: actions/upload-artifact@v4
with:
name: dashboard-build
path: ./dashboard/build/
retention-days: 1
build-images:
needs: build-dashboard
strategy:
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
platform: linux/amd64
runner: ubuntu-24.04
- arch: arm64
platform: linux/arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dashboard build
uses: actions/download-artifact@v4
with:
name: dashboard-build
path: ./dashboard/build/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ${{ matrix.arch }} image
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: true
file: ./Dockerfile
tags: |
${{ env.IMAGE }}-${{ matrix.arch }}
${{ env.GHCR_IMAGE }}-${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
push-manifest:
needs: [build-images]
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create tagged manifest
uses: int128/docker-manifest-create-action@v2
with:
tags: ${{ env.IMAGE }}
sources: |
${{ env.IMAGE }}-amd64
${{ env.IMAGE }}-arm64
- name: Create tagged manifest for GitHub
uses: int128/docker-manifest-create-action@v2
with:
tags: ${{ env.GHCR_IMAGE }}
sources: |
${{ env.GHCR_IMAGE }}-amd64
${{ env.GHCR_IMAGE }}-arm64