File tree 3 files changed +68
-7
lines changed
3 files changed +68
-7
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ name : Create and publish a Docker image
7
+
8
+ on :
9
+ push :
10
+ branches :
11
+ - ' main'
12
+ tags :
13
+ - ' v*'
14
+ pull_request :
15
+ branches :
16
+ - ' main'
17
+
18
+ env :
19
+ REGISTRY : ghcr.io
20
+ IMAGE_NAME : ${{ github.repository }}
21
+
22
+ jobs :
23
+ build-and-push-image :
24
+ runs-on : ubuntu-latest
25
+ permissions :
26
+ contents : read
27
+ packages : write
28
+
29
+ steps :
30
+ - name : Checkout repository
31
+ uses : actions/checkout@v2
32
+
33
+ - name : Log in to the Container registry
34
+ if : github.event_name != 'pull_request'
35
+ uses : docker/login-action@v2
36
+ with :
37
+ registry : ${{ env.REGISTRY }}
38
+ username : ${{ github.actor }}
39
+ password : ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ - name : Extract metadata (tags, labels) for Docker
42
+ id : meta
43
+ uses : docker/metadata-action@v4
44
+ with :
45
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46
+
47
+ - name : Build and push Docker image
48
+ uses : docker/build-push-action@v3
49
+ with :
50
+ context : .
51
+ push : ${{ github.event_name != 'pull_request' }}
52
+ tags : ${{ steps.meta.outputs.tags }}
53
+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1
- FROM node:alpine
1
+ FROM registry.access.redhat.com/ubi8/nodejs-14
2
2
3
- WORKDIR /usr/src/app
4
-
5
- COPY package* ./
3
+ USER 0
4
+ RUN mkdir -p /usr/src/app && \
5
+ chown -R 1001:0 /usr/src/app
6
6
7
+ USER 1001
8
+ WORKDIR /usr/src/app
9
+ ADD package* ./
7
10
RUN npm ci
8
-
9
- COPY . .
10
-
11
+ ADD . .
11
12
CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change @@ -56,3 +56,10 @@ The server application can be deployed with the workflow in `.github/workflows/m
56
56
57
57
Opens in the URL indicated in the Google Cloud platform dashboard under "Services".
58
58
59
+ ### Import in Openshift
60
+
61
+ Import the docker image as image stream:
62
+
63
+ ```
64
+ oc tag ghcr.io/katilp/node-json-api:main cms-info-server:latest --scheduled
65
+ ```
You can’t perform that action at this time.
0 commit comments