Skip to content

Commit

Permalink
feat: Rework github workflows, building and deploying is not separate
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxuser committed Dec 23, 2024
1 parent 48b4e75 commit 449e265
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Build and Deploy
on:
push:
branches:
- master
name: Build site
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v2.4.0
- name: Deploy MkDocs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install deps
run: pip install -U -r requirements.txt
- name: Build
run: mkdocs build --strict
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Website
on:
push:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install -U -r requirements.txt
- run: mkdocs build --strict
- uses: actions/upload-pages-artifact@v3
with:
path: 'site'
- id: deployment
if: github.ref_name == 'master'
uses: actions/deploy-pages@v4

0 comments on commit 449e265

Please sign in to comment.