File tree Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change 5
5
pull_request :
6
6
branches : [main]
7
7
8
+ env :
9
+ IMAGE_NAME : ${{ github.repository }}
10
+ REGISTRY : ghcr.io
11
+
8
12
jobs :
9
13
test :
10
14
name : ' Test'
11
15
runs-on : ubuntu-latest
16
+ permissions :
17
+ contents : read
12
18
steps :
13
19
- name : Checkout
14
20
uses : actions/checkout@v4
31
37
build :
32
38
name : ' Build'
33
39
runs-on : ubuntu-latest
40
+ permissions :
41
+ contents : read
34
42
steps :
35
43
- name : Checkout
36
44
uses : actions/checkout@v4
@@ -52,11 +60,49 @@ jobs:
52
60
- name : Docker build
53
61
run : docker build .
54
62
63
+ docker :
64
+ name : ' Docker publish'
65
+ needs : [test, build]
66
+ runs-on : ubuntu-latest
67
+ permissions :
68
+ contents : read
69
+ packages : write
70
+ steps :
71
+ - name : Checkout
72
+ uses : actions/checkout@v3
73
+
74
+ - name : Set up Docker Buildx
75
+ uses : docker/setup-buildx-action@v2
76
+
77
+ - name : Log into registry ${{ env.REGISTRY }}
78
+ uses : docker/login-action@v2
79
+ with :
80
+ registry : ${{ env.REGISTRY }}
81
+ username : ${{ github.actor }}
82
+ password : ${{ secrets.GITHUB_TOKEN }}
83
+
84
+ - name : Extract Docker metadata
85
+ id : meta
86
+ uses : docker/metadata-action@v4
87
+ with :
88
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
89
+
90
+ - name : Build and push Docker image
91
+ uses : docker/build-push-action@v3
92
+ with :
93
+ push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
94
+ tags : ${{ steps.meta.outputs.tags }}
95
+ labels : ${{ steps.meta.outputs.labels }}
96
+ platforms : linux/amd64,linux/arm64
97
+
55
98
deploy-demo :
56
99
name : Deploy demo site
57
100
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
58
101
needs : [test, build]
59
102
runs-on : ubuntu-latest
103
+ permissions :
104
+ contents : read
105
+ pages : write
60
106
steps :
61
107
- name : Checkout
62
108
uses : actions/checkout@v4
Original file line number Diff line number Diff line change 1
- 18
1
+ 20
Original file line number Diff line number Diff line change 1
- FROM node:18 -alpine as builder
1
+ FROM --platform=${BUILDPLATFORM} node:20 -alpine as builder
2
2
3
3
ARG DEFAULT_HOMESERVER
4
4
@@ -13,6 +13,6 @@ COPY tsconfig.json webpack.config.js webpack.parts.js ./
13
13
ENV DEFAULT_HOMESERVER ${DEFAULT_HOMESERVER}
14
14
RUN yarn build
15
15
16
- FROM nginxinc/nginx-unprivileged:1.21 -alpine
16
+ FROM --platform=${TARGETPLATFORM} nginxinc/nginx-unprivileged:1-alpine
17
17
18
18
COPY --from=builder /files-sdk-demo/dist /usr/share/nginx/html
You can’t perform that action at this time.
0 commit comments