-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (129 loc) · 4.02 KB
/
publish.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Build the docker images and push them to GitHub Packages
name: Publish Docker images
on:
workflow_dispatch:
pull_request:
env:
REGISTRY: ghcr.io
REPO_PATH: ${{ github.repository }}
REPO_NAME: ${{ github.event.repository.name }}
BUILD_PLATFORMS: linux/amd64,linux/arm64
jobs:
mods_list:
name: Get modified files
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changes
id: get-changes
uses: tj-actions/changed-files@v41
outputs:
modified_files: ${{ steps.get-changes.outputs.all_modified_files }}
builder_lite:
name: App Builder Lite
runs-on: ubuntu-latest
needs: [mods_list]
permissions:
packages: write
steps:
- name: Clone
uses: actions/checkout@v3
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Make full image name
run: |
echo "IMAGE=${REGISTRY}/${REPO_PATH,,}/${REPO_NAME,,}-lite" >>${GITHUB_ENV}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
- name: Set-up QEMU
uses: docker/setup-qemu-action@v2
- name: Set-up Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push container
uses: docker/build-push-action@v3
with:
file: lite/Dockerfile
platforms: ${{ env.BUILD_PLATFORMS }}
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
labels: ${{ steps.meta.outputs.labels }}
push: true
builder:
name: App Builder
runs-on: ubuntu-latest
needs: [mods_list, builder_lite]
permissions:
packages: write
steps:
- name: Clone
uses: actions/checkout@v3
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Make full image name
run: |
echo "IMAGE=${REGISTRY}/${REPO_PATH,,}/${REPO_NAME,,}" >>${GITHUB_ENV}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
- name: Set-up QEMU
uses: docker/setup-qemu-action@v2
- name: Set-up Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push container
uses: docker/build-push-action@v3
with:
file: full/Dockerfile
platforms: ${{ env.BUILD_PLATFORMS }}
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
labels: ${{ steps.meta.outputs.labels }}
push: true
dev_tools:
name: App Developer Tools
runs-on: ubuntu-latest
needs: [mods_list, builder]
permissions:
packages: write
steps:
- name: Clone
uses: actions/checkout@v3
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Make full image name
run: |
echo "IMAGE=${REGISTRY}/${REPO_PATH,,}/ledger-app-dev-tools" >>${GITHUB_ENV}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
- name: Set-up QEMU
uses: docker/setup-qemu-action@v2
- name: Set-up Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push container
uses: docker/build-push-action@v3
with:
file: dev-tools/Dockerfile
platforms: ${{ env.BUILD_PLATFORMS }}
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
labels: ${{ steps.meta.outputs.labels }}
push: true