From 43b564c575f048aa45f4d29de613bc904be8d15c Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Wed, 26 Feb 2025 13:25:27 -0800 Subject: [PATCH] ci: rework to use the container Signed-off-by: Davide Cavalca --- .github/workflows/ci.yml | 31 ------------------------------- .github/workflows/container.yml | 6 ++++++ .github/workflows/pages.yml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e8893da4..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI -on: - push: - branches: - - main -permissions: - contents: write -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - name: Configure Git Credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v4 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install mkdocs-material mkdocs-material[imaging] mkdocs-redirects - - run: mkdocs gh-deploy --force diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 9136ecf5..8853d56c 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -3,9 +3,15 @@ on: push: branches: - main + paths: + - .github/workflows/container.yml + - Dockerfile pull_request: branches: - main + paths: + - .github/workflows/container.yml + - Dockerfile env: REGISTRY: ghcr.io diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..2bd24311 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,31 @@ +name: Pages +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + container: ghcr.io/asahilinux/mkdocs-asahi + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Configure Git Credentials + run: | + git config --global user.name github-actions[bot] + git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com + - name: Build + if: github.event_name == 'pull_request' + run: mkdocs build + - name: Build and deploy to GitHub Pages + if: github.event_name != 'pull_request' + run: mkdocs gh-deploy --force