Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit 4e2d574

Browse files
authored
adding a docker build (#28)
1 parent 2a639bd commit 4e2d574

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed

.github/workflows/main.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v2
14+
with:
15+
submodules: recursive
16+
- name: Log in to GitHub Docker Registry
17+
uses: docker/login-action@v1
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Build container image
23+
uses: docker/build-push-action@v2
24+
with:
25+
push: true
26+
tags: |
27+
ghcr.io/${{ github.repository }}/varie-docs:${{ github.sha }}
28+
ghcr.io/${{ github.repository }}/varie-docs:latest
29+
- name: Secure Webhook
30+
uses: navied/[email protected]
31+
with:
32+
data: '{ "sha": "${{ github.sha }}" }'
33+
url: https://hooks.lukepolo.com/deploy-varie-docs
34+
hmacSecret: ${{ secrets.HMAC_SECRET }}

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "resources/docs/latest"]
22
path = resources/docs/latest
3-
url = git@github.com:variejs/docs.git
3+
url = https://github.com/variejs/docs.git

Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:10-alpine as builder
2+
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python
3+
4+
WORKDIR /build
5+
6+
COPY package*.json ./
7+
RUN npm ci
8+
9+
COPY . .
10+
11+
# Build the project
12+
RUN npm run prod
13+
14+
15+
FROM nginx:alpine
16+
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
17+
18+
# Copy from the stahg 1
19+
COPY --from=builder /build/public /app
20+
21+
EXPOSE 80
22+
ENTRYPOINT ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)