-
Notifications
You must be signed in to change notification settings - Fork 402
127 lines (109 loc) · 3.56 KB
/
Copy pathbuild-dev.yml
File metadata and controls
127 lines (109 loc) · 3.56 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
123
124
125
126
127
name: Build-Docker-dev
on:
push:
branches-ignore:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
env:
IMAGE_NAME: pasarguard/${{ github.event.repository.name }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-dashboard:
if: ${{ github.event_name == 'workflow_dispatch' || !contains(github.ref_name, '/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- 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@v7
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@v7
- name: Download dashboard build
uses: actions/download-artifact@v8
with:
name: dashboard-build
path: ./dashboard/build/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ${{ matrix.arch }} image
uses: docker/build-push-action@v7
with:
context: .
platforms: ${{ matrix.platform }}
push: true
file: ./Dockerfile
tags: |
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ matrix.arch }}
ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ 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@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
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_NAME }}:${{ github.ref_name }}
sources: |
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
- name: Create tagged manifest for GitHub
uses: int128/docker-manifest-create-action@v2
with:
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
sources: |
ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64
ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64