Skip to content

Commit

Permalink
Merge branch 'privacyguides:main' into pr-accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
friadev authored Nov 20, 2024
2 parents 7c8044e + 2d44ecf commit 2c7ad01
Show file tree
Hide file tree
Showing 49 changed files with 814 additions and 426 deletions.
88 changes: 88 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,20 @@
"blog"
]
},
{
"login": "friadev",
"name": "fria",
"avatar_url": "https://avatars.githubusercontent.com/u/138676274?v=4",
"profile": "https://friadev.github.io/",
"contributions": [
"doc",
"review",
"research",
"question",
"bug",
"ideas"
]
},
{
"login": "actions",
"name": "GitHub Actions",
Expand All @@ -245,6 +259,24 @@
"infra"
]
},
{
"login": "triplebit",
"name": "Triplebit",
"avatar_url": "https://avatars.githubusercontent.com/u/178061783?v=4",
"profile": "https://www.triplebit.org/",
"contributions": [
"infra"
]
},
{
"login": "magicgrants",
"name": "MAGIC Grants",
"avatar_url": "https://avatars.githubusercontent.com/u/90805358?v=4",
"profile": "https://magicgrants.org/",
"contributions": [
"business"
]
},
{
"login": "netlify",
"name": "Netlify",
Expand Down Expand Up @@ -2868,6 +2900,62 @@
"contributions": [
"doc"
]
},
{
"login": "yusuf-daglioglu",
"name": "Yusuf Daglioglu",
"avatar_url": "https://avatars.githubusercontent.com/u/90555550?v=4",
"profile": "https://github.com/yusuf-daglioglu",
"contributions": [
"doc"
]
},
{
"login": "yikerman",
"name": "Yi Cao",
"avatar_url": "https://avatars.githubusercontent.com/u/32544798?v=4",
"profile": "https://ycao.net/",
"contributions": [
"doc"
]
},
{
"login": "sdhlfqr",
"name": "Sayf Dhū al-Faqār",
"avatar_url": "https://avatars.githubusercontent.com/u/155405590?v=4",
"profile": "https://github.com/sdhlfqr",
"contributions": [
"doc"
]
},
{
"login": "eylenburg",
"name": "eylenburg",
"avatar_url": "https://avatars.githubusercontent.com/u/84839316?v=4",
"profile": "https://github.com/eylenburg",
"contributions": [
"doc"
]
},
{
"login": "PASSK3YS",
"name": "Kieran Colfer",
"avatar_url": "https://avatars.githubusercontent.com/u/54213179?v=4",
"profile": "https://github.com/PASSK3YS",
"contributions": [
"doc"
]
},
{
"login": "SamsungGalaxyPlayer",
"name": "Justin Ehrenhofer",
"avatar_url": "https://avatars.githubusercontent.com/u/12520755?v=4",
"profile": "https://github.com/SamsungGalaxyPlayer",
"contributions": [
"doc",
"business",
"fundingFinding"
]
}
],
"contributorsPerLine": 5,
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/build-blog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,33 @@ jobs:
with:
cache: "pipenv"

- name: Install Python (no pipenv)
if: ${{ !inputs.privileged }}
uses: actions/setup-python@v5

- name: Install Python Dependencies
if: inputs.privileged
run: |
pip install pipenv
pipenv install
sudo apt install pngquant
- name: Build Website
- name: Install Python Dependencies (Unprivileged)
if: ${{ !inputs.privileged }}
run: |
pip install mkdocs-material mkdocs-rss-plugin mkdocs-glightbox mkdocs-macros-plugin
sudo apt install pngquant
- name: Build Website (Privileged)
if: inputs.privileged
run: |
pipenv run mkdocs build --config-file mkdocs.blog.yml
- name: Build Website (Unprivileged)
if: ${{ !inputs.privileged }}
run: |
BUILD_INSIDERS=false mkdocs build --config-file mkdocs.blog.yml
- name: Package Website
run: |
tar -czf site-build-blog.tar.gz site
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ jobs:
env:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
steps:
- name: Save PR metadata
run: |
mkdir -p ./metadata
echo ${{ github.event.number }} > ./metadata/NR
echo ${{ github.event.pull_request.head.sha }} > ./metadata/SHA
- name: Set submodules for fork
if: env.ACTIONS_SSH_KEY == ''
id: submodules-fork
run: |
echo 'submodules={"repo":["brand","i18n"]}' >> "$GITHUB_OUTPUT"
echo "privileged=false" >> "$GITHUB_OUTPUT"
echo "false" > ./metadata/PRIVILEGED
- name: Set submodules for main repo
if: env.ACTIONS_SSH_KEY != ''
id: submodules-main
run: |
echo 'submodules={"repo":["brand","i18n","mkdocs-material-insiders"]}' >> "$GITHUB_OUTPUT"
echo "privileged=true" >> "$GITHUB_OUTPUT"
- name: Save PR metadata
run: |
mkdir -p ./metadata
echo ${{ github.event.number }} > ./metadata/NR
echo ${{ github.event.pull_request.head.sha }} > ./metadata/SHA
echo "true" > ./metadata/PRIVILEGED
- name: Upload metadata as artifact
uses: actions/upload-artifact@v4
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
strict:
type: boolean
default: false
cache:
type: boolean
default: true

permissions:
contents: read
Expand Down Expand Up @@ -119,6 +122,7 @@ jobs:
- name: Restore Privacy Plugin Cache
uses: actions/cache/[email protected]
id: privacy_cache_restore
if: inputs.cache
with:
key: privacy-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/privacy/**') }}
path: |
Expand All @@ -131,6 +135,7 @@ jobs:
- name: Restore Social Plugin Cache
uses: actions/cache/[email protected]
id: social_cache_restore
if: inputs.cache
with:
key: social-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
path: |
Expand All @@ -143,6 +148,7 @@ jobs:
- name: Restore Optimize Plugin Cache
uses: actions/cache/[email protected]
id: optimize_cache_restore
if: inputs.cache
with:
key: optimize-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
path: |
Expand Down Expand Up @@ -176,7 +182,7 @@ jobs:
- name: Find Privacy Plugin Cache
uses: actions/cache/[email protected]
if: steps.privacy_cache_restore.outputs.cache-hit != 'true'
if: steps.privacy_cache_restore.outputs.cache-hit != 'true' && inputs.cache
id: privacy_cache_test
with:
key: privacy-cache-privacyguides/privacyguides.org-${{ hashfiles('.cache/plugin/privacy/**') }}
Expand All @@ -186,7 +192,7 @@ jobs:
- name: Find Social Plugin Cache
uses: actions/cache/[email protected]
if: steps.social_cache_restore.outputs.cache-hit != 'true'
if: steps.social_cache_restore.outputs.cache-hit != 'true' && inputs.cache
id: social_cache_test
with:
key: social-cache-privacyguides/privacyguides.org-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
Expand All @@ -197,7 +203,7 @@ jobs:
- name: Find Optimize Plugin Cache
uses: actions/cache/[email protected]
if: steps.optimize_cache_restore.outputs.cache-hit != 'true'
if: steps.optimize_cache_restore.outputs.cache-hit != 'true' && inputs.cache
id: optimize_cache_test
with:
key: optimize-cache-privacyguides/privacyguides.org-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
Expand All @@ -207,14 +213,14 @@ jobs:
- name: Save Privacy Plugin Cache
uses: actions/cache/[email protected]
if: steps.privacy_cache_test.outputs.cache-hit != 'true'
if: steps.privacy_cache_test.outputs.cache-hit != 'true' && inputs.cache
with:
key: privacy-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/privacy/**') }}
path: .cache/plugin/privacy

- name: Save Social Plugin Cache
uses: actions/cache/[email protected]
if: steps.social_cache_test.outputs.cache-hit != 'true'
if: steps.social_cache_test.outputs.cache-hit != 'true' && inputs.cache
with:
key: social-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
path: |
Expand All @@ -223,7 +229,7 @@ jobs:
- name: Save Optimize Plugin Cache
uses: actions/cache/[email protected]
if: steps.optimize_cache_test.outputs.cache-hit != 'true'
if: steps.optimize_cache_test.outputs.cache-hit != 'true' && inputs.cache
with:
key: optimize-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
path: .cache/plugin/optimize
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/publish-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,3 @@ jobs:
with:
source-repo: "[email protected]:privacyguides/privacyguides.org.git"
destination-repo: "[email protected]:privacyguides/privacyguides.org.git"

sourcehut:
runs-on: ubuntu-latest
steps:
- name: Mirror to SourceHut
uses: wearerequired/git-mirror-action@v1
env:
SSH_PRIVATE_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
with:
source-repo: "[email protected]:privacyguides/privacyguides.org.git"
destination-repo: "[email protected]:~jonaharagon/privacyguides.org"
39 changes: 36 additions & 3 deletions .github/workflows/publish-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
outputs:
pr_number: ${{ steps.metadata.outputs.pr_number }}
sha: ${{ steps.metadata.outputs.sha }}
privileged: ${{ steps.metadata.outputs.privileged }}

steps:
- name: Download Website Build Artifact
Expand Down Expand Up @@ -86,8 +87,9 @@ jobs:
unzip metadata.zip -d metadata
echo "pr_number=$(cat metadata/NR)" >> "$GITHUB_OUTPUT"
echo "sha=$(cat metadata/SHA)" >> "$GITHUB_OUTPUT"
echo "privileged=$(cat metadata/PRIVILEGED)" >> "$GITHUB_OUTPUT"
deploy:
deploy_netlify:
needs: metadata
permissions:
contents: read
Expand All @@ -99,15 +101,43 @@ jobs:
secrets:
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}

deploy_garage:
needs: metadata
permissions:
contents: read

uses: privacyguides/webserver/.github/workflows/deploy-garage-preview.yml@main
with:
alias: ${{ needs.metadata.outputs.pr_number }}
bucket: ${{ vars.PREVIEW_GARAGE_BUCKET }}
hostname: ${{ vars.PREVIEW_GARAGE_HOSTNAME }}
secrets:
PREVIEW_GARAGE_KEY_ID: ${{ secrets.PREVIEW_GARAGE_KEY_ID }}
PREVIEW_GARAGE_SECRET_KEY: ${{ secrets.PREVIEW_GARAGE_SECRET_KEY }}

comment:
permissions:
pull-requests: write
needs: [deploy, metadata]
needs: [deploy_garage, metadata]
runs-on: ubuntu-latest
env:
address: ${{ needs.deploy.outputs.address }}
address: ${{ needs.deploy_garage.outputs.address }}
steps:
- uses: thollander/[email protected]
if: ${{ needs.metadata.outputs.privileged == 'true' }}
with:
pr_number: ${{ needs.metadata.outputs.pr_number }}
message: |
### <span aria-hidden="true">✅</span> Your preview is ready!
| Name | Link |
| :---: | ---- |
| <span aria-hidden="true">🔨</span> Latest commit | ${{ needs.metadata.outputs.sha }} |
| <span aria-hidden="true">😎</span> Preview | ${{ env.address }} |
comment_tag: deployment

- uses: thollander/[email protected]
if: ${{ needs.metadata.outputs.privileged == 'false' }}
with:
pr_number: ${{ needs.metadata.outputs.pr_number }}
message: |
Expand All @@ -117,4 +147,7 @@ jobs:
| :---: | ---- |
| <span aria-hidden="true">🔨</span> Latest commit | ${{ needs.metadata.outputs.sha }} |
| <span aria-hidden="true">😎</span> Preview | ${{ env.address }} |
Please note that this preview was built from an untrusted source, so it was not granted access to all mkdocs-material features.
Maintainers should ensure this PR has been reviewed locally with a full build before merging.
comment_tag: deployment
17 changes: 15 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ jobs:
lang: ${{ matrix.lang }}
context: production
continue-on-error: false
cache: false

build_blog:
needs: submodule
permissions:
contents: read
uses: ./.github/workflows/build-blog.yml
with:
repo: ${{ github.repository }}
ref: ${{ github.ref }}
continue-on-error: false

release:
name: Create release notes
Expand All @@ -84,12 +95,14 @@ jobs:
makeLatest: true

deploy:
needs: build
needs: [build, build_blog]
uses: privacyguides/webserver/.github/workflows/deploy-all.yml@main
secrets:
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
PROD_MINIO_KEY_ID: ${{ secrets.PROD_MINIO_KEY_ID }}
PROD_MINIO_SECRET_KEY: ${{ secrets.PROD_MINIO_SECRET_KEY }}
PROD_GARAGE_KEY_ID: ${{ secrets.PROD_GARAGE_KEY_ID }}
PROD_GARAGE_SECRET_KEY: ${{ secrets.PROD_GARAGE_SECRET_KEY }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLUSTER_USERNAME: ${{ secrets.CLUSTER_USERNAME }}
Expand All @@ -99,5 +112,5 @@ jobs:

cleanup:
if: ${{ always() }}
needs: build
needs: [build, build_blog]
uses: privacyguides/.github/.github/workflows/cleanup.yml@main
Loading

0 comments on commit 2c7ad01

Please sign in to comment.