-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 1.93 KB
/
deploy.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
name: Deploy docs
on:
push:
branches:
- develop
- master
permissions:
contents: write
env:
ARTIFACT: docs.tar.gz
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Fetch LFS files
run: git lfs pull
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Cache dependencies
uses: actions/cache@v4
with:
key: mkdocs-material-${{ github.ref }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build the site and archive content
run: |
mkdocs build
tar -czvf $ARTIFACT site/*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: ${{ env.ARTIFACT }}
- name: Clean up the build
if: always()
run: rm -rf site
outputs:
artifact: ${{ env.ARTIFACT }}
deploy_dev:
if: github.ref == 'refs/heads/develop'
needs: build
uses: ./.github/workflows/deploy_job.yml
with:
ENV_NAME: dev
ARTIFACT: ${{ needs.build.outputs.artifact }}
REMOTE_HOST: ${{ vars.DEV_SERVER_HOST }}
REMOTE_PORT: ${{ fromJSON(vars.DEV_SSH_PORT) }}
REMOTE_USER: ${{ vars.DEV_SERVER_USER}}
secrets:
REMOTE_SSH_KEY: ${{ secrets.DEV_PRIVATE_KEY }}
#BASE_PATH: /var/www/html
deploy_prd:
if: github.ref == 'refs/heads/master'
needs: build
uses: ./.github/workflows/deploy_job.yml
with:
ENV_NAME: prd
ARTIFACT: ${{ needs.build.outputs.artifact }}
REMOTE_HOST: ${{ vars.PRD_SERVER_HOST }}
REMOTE_PORT: ${{ fromJSON(vars.PRD_SSH_PORT) }}
REMOTE_USER: ${{ vars.PRD_SERVER_USER}}
secrets:
REMOTE_SSH_KEY: ${{ secrets.PRD_PRIVATE_KEY }}
#BASE_PATH: /var/www/html