|
|
@ -1,4 +1,4 @@ |
|
|
|
name: Build & Publish Latest |
|
|
|
name: Production |
|
|
|
|
|
|
|
on: |
|
|
|
workflow_dispatch: |
|
|
@ -7,15 +7,15 @@ on: |
|
|
|
- "v*" |
|
|
|
|
|
|
|
jobs: |
|
|
|
deploy: |
|
|
|
name: Build & Deploy |
|
|
|
docker: |
|
|
|
name: Build & Deploy Docker |
|
|
|
runs-on: ubuntu-latest |
|
|
|
if: | |
|
|
|
github.repository_owner == 'wg-easy' && |
|
|
|
startsWith(github.ref, 'refs/tags/v') |
|
|
|
permissions: |
|
|
|
packages: write |
|
|
|
contents: write |
|
|
|
contents: read |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
|
|
|
@ -48,31 +48,45 @@ jobs: |
|
|
|
with: |
|
|
|
context: . |
|
|
|
push: true |
|
|
|
platforms: linux/amd64,linux/arm64/v8 |
|
|
|
platforms: linux/amd64,linux/arm64 |
|
|
|
tags: ${{ steps.meta.outputs.tags }} |
|
|
|
labels: ${{ steps.meta.outputs.labels }} |
|
|
|
cache-from: type=gha |
|
|
|
cache-to: type=gha,mode=min |
|
|
|
|
|
|
|
docs: |
|
|
|
name: Build & Deploy Docs |
|
|
|
runs-on: ubuntu-latest |
|
|
|
if: | |
|
|
|
github.repository_owner == 'wg-easy' && |
|
|
|
startsWith(github.ref, 'refs/tags/v') |
|
|
|
permissions: |
|
|
|
contents: write |
|
|
|
needs: docker |
|
|
|
steps: |
|
|
|
- name: Setup Python |
|
|
|
uses: actions/setup-python@v5 |
|
|
|
with: |
|
|
|
python-version: 3.11.9 |
|
|
|
cache: "pip" |
|
|
|
|
|
|
|
- name: Install Dependencies |
|
|
|
run: | |
|
|
|
pip install mkdocs-material |
|
|
|
pip install pillow cairosvg mike |
|
|
|
- name: Setup Docs Deploy |
|
|
|
pip install -r docs/requirements.txt |
|
|
|
|
|
|
|
- name: Setup Git User |
|
|
|
run: | |
|
|
|
git config --global user.name 'Docs Deploy Bot' |
|
|
|
git config --global user.email 'docs.deploy@users.noreply.github.com' |
|
|
|
git config --global user.name 'github-actions[bot]' |
|
|
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
|
|
|
|
|
|
|
- name: Build Docs Website |
|
|
|
run: | |
|
|
|
cd docs |
|
|
|
git fetch origin gh-pages --depth=1 |
|
|
|
mike deploy --push --update-aliases ${{ github.ref_name }} latest |
|
|
|
git fetch origin gh-pages --depth=1 || true |
|
|
|
|
|
|
|
# latest will point to old docs if old tag is pushed |
|
|
|
|
|
|
|
# Extract version numbers (remove 'v' prefix) |
|
|
|
# Extract version numbers |
|
|
|
DOCS_VERSION=${GITHUB_REF#refs/tags/} # e.g. v1.2.3 or v1.2.3-beta |
|
|
|
MINOR_VERSION=$(echo $DOCS_VERSION | cut -d. -f1,2) # e.g. v1.2 |
|
|
|
|
|
|
@ -81,6 +95,6 @@ jobs: |
|
|
|
echo "Stable release detected: $DOCS_VERSION" |
|
|
|
mike deploy --push --update-aliases $MINOR_VERSION latest |
|
|
|
else |
|
|
|
echo "Prerelease detected: $DOCS_VERSION" |
|
|
|
echo "Pre-release detected: $DOCS_VERSION" |
|
|
|
mike deploy --push --update-aliases Pre-release |
|
|
|
fi |
|
|
|