2022-12-30 09:08:29 -06:00
|
|
|
name: Deploy Preview to Firebase
|
2022-12-30 08:52:59 -06:00
|
|
|
'on': pull_request
|
|
|
|
jobs:
|
|
|
|
build_and_preview:
|
|
|
|
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Hugo setup
|
2022-12-31 23:01:47 -06:00
|
|
|
uses: peaceiris/actions-hugo@v2.6.0
|
2022-12-30 08:52:59 -06:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
2023-09-10 00:25:07 -05:00
|
|
|
uses: actions/checkout@v4
|
2022-12-30 08:52:59 -06:00
|
|
|
with:
|
|
|
|
submodules: true # Fetch Hugo themes (true OR recursive)
|
|
|
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
|
|
|
|
|
|
|
- name: Build with Hugo
|
|
|
|
env:
|
|
|
|
# For maximum backward compatibility with Hugo modules
|
|
|
|
HUGO_ENVIRONMENT: production
|
|
|
|
HUGO_ENV: production
|
|
|
|
run: |
|
2023-07-14 06:56:33 -05:00
|
|
|
hugo -E -F --minify -s exampleSite --themesDir ../.. -d ../public --baseURL https://blowfish.page
|
2022-12-30 08:52:59 -06:00
|
|
|
|
|
|
|
- name: Deploy preview
|
|
|
|
uses: FirebaseExtended/action-hosting-deploy@v0
|
|
|
|
with:
|
|
|
|
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
2022-12-30 08:57:13 -06:00
|
|
|
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BLOWFISH_21FFF }}'
|
2022-12-30 08:52:59 -06:00
|
|
|
expires: 30d
|
2023-01-17 15:33:22 -06:00
|
|
|
channelId: preview-${{ github.event.number }}
|
2022-12-30 08:52:59 -06:00
|
|
|
projectId: blowfish-21fff
|