Merge branch 'develop' #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |