Skip to content

Commit

Permalink
Merge branch 'main' into patch-5
Browse files Browse the repository at this point in the history
  • Loading branch information
I-I-IT authored Nov 11, 2024
2 parents ad3f20c + d62e221 commit c41e786
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 22 deletions.
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"
20 changes: 17 additions & 3 deletions .github/workflows/publish-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
echo "pr_number=$(cat metadata/NR)" >> "$GITHUB_OUTPUT"
echo "sha=$(cat metadata/SHA)" >> "$GITHUB_OUTPUT"
deploy:
deploy_netlify:
needs: metadata
permissions:
contents: read
Expand All @@ -99,13 +99,27 @@ 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_netlify, metadata]
runs-on: ubuntu-latest
env:
address: ${{ needs.deploy.outputs.address }}
address: ${{ needs.deploy_netlify.outputs.address }}
steps:
- uses: thollander/[email protected]
with:
Expand Down
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

0 comments on commit c41e786

Please sign in to comment.