From ba37a853c8978894b58d15f89f50a32a49a5a546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Fri, 30 Dec 2022 14:52:59 +0000 Subject: [PATCH] adding firebase preview action --- .github/workflows/firebase-preview.yml | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/firebase-preview.yml diff --git a/.github/workflows/firebase-preview.yml b/.github/workflows/firebase-preview.yml new file mode 100644 index 00000000..b63104b7 --- /dev/null +++ b/.github/workflows/firebase-preview.yml @@ -0,0 +1,35 @@ +name: Deploy Preview +'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 + uses: peaceiris/actions-hugo@v2.4.12 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + 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: | + hugo --minify -s exampleSite --themesDir ../.. -d ../docs --baseURL https://blowfish.page + + - name: Deploy preview + uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_HOMEPAGE_A0C38 }}' + expires: 30d + channelId: preview + projectId: blowfish-21fff