Skip to content

Commit e37e6c0

Browse files
authored
Merge pull request #15 from CyberPlanning/developement
Adding CI/CD
2 parents dc06cd9 + d130da4 commit e37e6c0

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-5
lines changed
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 v2
7+
8+
on:
9+
push:
10+
branches: ['release']
11+
workflow_dispatch:
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
build-and-push-image:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v2
27+
28+
- name: Log in to the Container registry
29+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
30+
with:
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Extract metadata (tags, labels) for Docker
36+
id: meta
37+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
38+
with:
39+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40+
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
FROM node:13-alpine
1+
FROM node:13-alpine AS builder
22

33
WORKDIR /app
44

55
RUN npm install -g --unsafe-perm create-elm-app
66

7-
EXPOSE 3000
7+
COPY . .
88

9-
ENTRYPOINT [ "/usr/local/bin/elm-app" ]
9+
RUN /usr/local/bin/elm-app build
1010

11-
# to compile docker run --rm -v $PWD:/app elm-compiler
12-
CMD [ "build" ]
11+
FROM nginx
12+
13+
COPY --from=builder /app/build /usr/share/nginx/html/
14+
15+
EXPOSE 80

0 commit comments

Comments
 (0)