-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (157 loc) · 5.31 KB
/
docs-local.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Docs
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
build:
name: Build & Publish 🚀
runs-on: ubuntu-latest
env:
INPUTPATH: asciidocs
OUTPUTPATH: dist
SLIDES: true
BRANCH: gh-pages
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build
uses: quirinecker/asciidoctor-convert-action@main
with:
slides: ${{ env.SLIDES }}
inputPath: ${{ env.INPUTPATH }}
outputPath: ${{ env.OUTPUTPATH }}
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
TOKEN: ${{ github.TOKEN }}
BRANCH: ${{ env.BRANCH }}
FOLDER: ${{ env.OUTPUTPATH }}
bump:
name: Get And Bump SemVer 👊
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
RELEASE_BRANCHES: master
DEFAULT_BUMP: patch
WITH_V: false
docker-build:
name: Build Docker Image 🐋
runs-on: ubuntu-latest
needs: [bump]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout site
uses: actions/checkout@v4
with:
ref: gh-pages
path: site
- name: Touch .env file
run: touch site/.env
- name: Fill .env file
run: |
echo NEXT_PUBLIC_PORT=${{ secrets.PORT }} >> site/.env
echo NEXT_PUBLIC_START_PAGE=${{ secrets.START_PAGE }} >> site/.env
echo NEXT_PUBLIC_PLANTUML_URL=${{ secrets.PLANTUML_URL }} >> site/.env
echo NEXT_PUBLIC_SERVER_URL=${{ secrets.SERVER_URL }} >> site/.env
echo NEXT_PUBLIC_IS_APP_FOLDER=true >> site/.env
- name: Touch keycloak.json file
run: touch site/keycloak.json
- name: Fill keycloak.json file
run: |
cat <<EOF >> site/keycloak.json
${{ secrets.KEYCLOAK_FILE }}
EOF
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ secrets.DOCKER_HUB_USER }}/${{ secrets.DOCKER_IMAGE_NAME}}:latest
deploy:
name: Deployment 💻
runs-on: ubuntu-latest
needs: [docker-build]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install OpenVPN
run: |
sudo apt update
sudo apt install -y openvpn openvpn-systemd-resolved
- name: Touch OVPN client-config file
run: touch client.ovpn
- name: Fill OVPN client-config file
run: |
echo "${{ secrets.VPN_OVPN_FILE }}" >> client.ovpn
- name: Connect to VPN 🔓
uses: "kota65535/github-openvpn-connect-action@v3"
with:
config_file: client.ovpn
username: ${{ secrets.VPN_USERNAME }}
password: ${{ secrets.VPN_PASSWORD }}
- name: Installing SSH key 🔑
uses: UnterrainerInformatik/setup-ssh-action@v1
with:
key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
- name: Create deploy directory 🚧
uses: UnterrainerInformatik/ssh-mkdir-action@v1
with:
dir: ${{ secrets.DEPLOY_DIR }}
user: ${{ secrets.DEPLOY_SSH_USER }}
host: ${{ secrets.DEPLOY_SERVER }}
port: ${{ secrets.DEPLOY_SSH_PORT }}
- name: Create data directory 🚧
uses: UnterrainerInformatik/ssh-mkdir-action@v1
with:
dir: ${{ secrets.DATA_DIR }}
user: ${{ secrets.DEPLOY_SSH_USER }}
host: ${{ secrets.DEPLOY_SERVER }}
port: ${{ secrets.DEPLOY_SSH_PORT }}
- name: Touch .env file for deployment
run: touch ./deploy/.env
- name: Fill .env file for deployment
run: |
echo WEBSERVER_PORT=${{ secrets.WEBSERVER_PORT }} >> ./deploy/.env
echo INTERNAL_PORT=${{ secrets.PORT }} >> ./deploy/.env
echo DOCKER_HUB_USER=${{ secrets.DOCKER_HUB_USER }} >> ./deploy/.env
echo DOCKER_IMAGE_NAME=${{ secrets.DOCKER_IMAGE_NAME }} >> ./deploy/.env
- name: Deploy using SSH 🚛
uses: UnterrainerInformatik/ssh-deploy-action@v1
with:
source: ./deploy/
target: ${{ secrets.DEPLOY_DIR }}
chmod-mask: 777
chmod-selector: ./deploy/*.sh
user: ${{ secrets.DEPLOY_SSH_USER }}
host: ${{ secrets.DEPLOY_SERVER }}
port: ${{ secrets.DEPLOY_SSH_PORT }}
- name: Run using SSH 🏃
uses: UnterrainerInformatik/ssh-run-action@v1
with:
dir: ${{ secrets.DEPLOY_DIR }}
file: up.sh
user: ${{ secrets.DEPLOY_SSH_USER }}
host: ${{ secrets.DEPLOY_SERVER }}
port: ${{ secrets.DEPLOY_SSH_PORT }}