-
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GitHub Actions instead of Netlify (#2462)
- Loading branch information
1 parent
6aa14e8
commit bcf87a0
Showing
7 changed files
with
201 additions
and
177 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright (c) 2022-2024 Jonah Aragon <[email protected]> | ||
# Copyright (c) 2024 Jonah Aragon <[email protected]> | ||
|
||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to | ||
|
@@ -18,36 +18,33 @@ | |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
# IN THE SOFTWARE. | ||
|
||
name: 🛠️ Deploy to GitHub Pages | ||
name: Build Offline Website | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHON_VERSION: 3.8 | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '0' | ||
ssh-key: ${{ secrets.ACTIONS_SSH_KEY }} | ||
submodules: 'true' | ||
persist-credentials: 'false' | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: repo-* | ||
path: modules | ||
|
||
- name: Pages setup | ||
uses: actions/configure-pages@v4 | ||
- run: | | ||
rmdir modules/mkdocs-material | ||
mv modules/repo-mkdocs-material-insiders modules/mkdocs-material | ||
rmdir theme/assets/brand | ||
mv modules/repo-brand theme/assets/brand | ||
- name: Python setup | ||
uses: actions/setup-python@v5 | ||
|
@@ -70,31 +67,40 @@ jobs: | |
- name: Build website | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARDS: true | ||
CARDS: false | ||
CONTEXT: deploy-preview | ||
NETLIFY: true | ||
run: | | ||
pipenv run mkdocs build --config-file config/mkdocs.en.yml | ||
pipenv run mkdocs build --config-file config/mkdocs-offline.yml | ||
pipenv run mkdocs --version | ||
- name: Package website | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: site | ||
- name: Package website | ||
run: | | ||
tar -czvf offline.tar.gz site | ||
zip -r -q offline.zip site | ||
deploy: | ||
name: Deploy | ||
needs: build | ||
- name: Upload tar.gz file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: offline.tar.gz | ||
path: offline.tar.gz | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
- name: Upload zip file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: offline.zip | ||
path: offline.zip | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
- name: Create ZIM File | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/openzim/zim-tools:3.1.3 | ||
options: -v ${{ github.workspace }}:/data | ||
run: | | ||
zimwriterfs -w index.html -I assets/brand/logos/png/square/pg-yellow.png -l eng -t "Privacy Guides" -d "Your central privacy and security resource to protect yourself online." -c "Privacy Guides" -p "Jonah Aragon" -n "Privacy Guides" -e "https://github.com/privacyguides/privacyguides.org" /data/site /data/privacy_guides.zim | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@main | ||
- name: Upload ZIM file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: offline-privacy_guides.zim | ||
path: offline-privacy_guides.zim |
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
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
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
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
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
Oops, something went wrong.