-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (57 loc) · 2.19 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build /public and delpoy to gh-pages with docker container
env:
docker_repository: "docker.edu-sharing.com"
on:
push:
branches:
- main
- master
- gh-pages
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: remove public and data-dir if already exists
run: rm -rf public data
- run: mkdir public
- run: chmod -R 777 public # user in container is node which won't have write access to public
- run: mkdir data
- run: chmod -R 777 data # user in container is node which won't have write access to public
- run: git clone https://github.com/openeduhub/oeh-metadata-vocabs.git data/ # <-- add link to your repo here
- name: make .env file
run: echo "BASEURL=" > .env
- name: login to edu-sharing container registry
uses: docker/login-action@v2
with:
registry: ${{ env.docker_repository }}
username: ${{ secrets.DOCKER_EDU_HUB_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_EDU_HUB_REGISTRY_PASSWORD }}
- name: build public dir with docker image
run: >
docker run
-v $(pwd)/public:/app/public
-v $(pwd)/data:/app/data
-v $(pwd)/.env:/app/.env
-v $(pwd)/.skohub/static/img:/app/static/img
-v $(pwd)/.skohub/config.yaml:/app/config.yaml
-e GATSBY_RESPOSITORY_URL=https://github.com/skohub-io/skohub-docker-vocabs.git
docker.edu-sharing.com/projects/wlo/edu_sharing-projects-wlo-skohub-vocabs:main
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages
cname: vocabs.openeduhub.de