ci: Build blog automatically on release

This commit is contained in:
Jonah Aragon 2024-11-11 13:06:50 -06:00
parent 0b78517a9d
commit d62e221615
No known key found for this signature in database
2 changed files with 25 additions and 8 deletions

View File

@ -27,6 +27,9 @@ on:
strict:
type: boolean
default: false
cache:
type: boolean
default: true
permissions:
contents: read
@ -119,6 +122,7 @@ jobs:
- name: Restore Privacy Plugin Cache
uses: actions/cache/restore@v4.0.2
id: privacy_cache_restore
if: inputs.cache
with:
key: privacy-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/privacy/**') }}
path: |
@ -131,6 +135,7 @@ jobs:
- name: Restore Social Plugin Cache
uses: actions/cache/restore@v4.0.2
id: social_cache_restore
if: inputs.cache
with:
key: social-cache-${{ inputs.repo }}-${{ inputs.lang }}-${{ hashfiles('.cache/plugin/social/manifest.json') }}
path: |
@ -143,6 +148,7 @@ jobs:
- name: Restore Optimize Plugin Cache
uses: actions/cache/restore@v4.0.2
id: optimize_cache_restore
if: inputs.cache
with:
key: optimize-cache-${{ inputs.repo }}-${{ hashfiles('.cache/plugin/optimize/manifest.json') }}
path: |
@ -176,7 +182,7 @@ jobs:
- name: Find Privacy Plugin Cache
uses: actions/cache/restore@v4.0.2
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/**') }}
@ -186,7 +192,7 @@ jobs:
- name: Find Social Plugin Cache
uses: actions/cache/restore@v4.0.2
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') }}
@ -197,7 +203,7 @@ jobs:
- name: Find Optimize Plugin Cache
uses: actions/cache/restore@v4.0.2
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') }}
@ -207,14 +213,14 @@ jobs:
- name: Save Privacy Plugin Cache
uses: actions/cache/save@v4.0.2
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/save@v4.0.2
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: |
@ -223,7 +229,7 @@ jobs:
- name: Save Optimize Plugin Cache
uses: actions/cache/save@v4.0.2
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

View File

@ -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
@ -84,7 +95,7 @@ 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 }}
@ -101,5 +112,5 @@ jobs:
cleanup:
if: ${{ always() }}
needs: build
needs: [build, build_blog]
uses: privacyguides/.github/.github/workflows/cleanup.yml@main