Skip to content

Commit abc6d4b

Browse files
authored
Merge pull request #12 from MathisBurger/dev
first functional publish script [v1.0.0]
2 parents 6aa69b5 + 5faee24 commit abc6d4b

4 files changed

Lines changed: 101 additions & 28 deletions

File tree

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/build
3+
/.svelte-kit

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Publish to Github Pages
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
tags:
8+
- 'v*'
9+
branches:
10+
- master
11+
12+
jobs:
13+
gh-pages:
14+
if: github.event.pull_request.merged == true
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [14.x]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Install node
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: npm i
27+
- run: npm run build
28+
- name: Deploy to Github Pages
29+
uses: JamesIves/github-pages-deploy-action@4.1.4
30+
with:
31+
branch: gh-pages
32+
folder: build
33+
34+
docker:
35+
if: github.event.pull_request.merged == true
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: checkout code
39+
uses: actions/checkout@v2
40+
- name: set up qemu
41+
uses: docker/setup-qemu-action@v1
42+
- name: set up buildx
43+
uses: docker/setup-buildx-action@v1
44+
- name: log in to ghcr
45+
uses: docker/login-action@v1
46+
with:
47+
registry: ghcr.io
48+
username: mathisburger
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
- name: build and push
51+
uses: docker/build-push-action@v2
52+
with:
53+
push: true
54+
tags: ghcr.io/mathisburger/mathonweb:${{ github.ref }}
55+
56+
release:
57+
if: github.event.pull_request.merged == true
58+
name: publish release
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: checkout
62+
uses: actions/checkout@v2
63+
- name: create Release
64+
uses: actions/create-release@v1
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
tag_name: ${{ github.ref }}
69+
release_name: ${{ github.ref }}
70+
body: |
71+
Changes in this Release:
72+
- Checkout <a href="https://mathonweb.mathis-burger.de">https://mathonweb.mathis-burger.de</a> to
73+
get the latest changelogs.
74+
draft: false
75+
prerelease: false

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:14-alpine AS build
2+
3+
WORKDIR /buildApp
4+
5+
COPY . .
6+
RUN npm i
7+
RUN npm run build
8+
9+
FROM node:14-alpine as final
10+
11+
WORKDIR /app
12+
13+
RUN mkdir build
14+
15+
COPY --from=build ./buildApp/build ./build
16+
17+
RUN npm i -g serve
18+
19+
EXPOSE 5000
20+
21+
CMD ["serve", "-s", "build"]
22+
23+

0 commit comments

Comments
 (0)