From b608e5fc3c9f9a92dc8783b910bb0e46d01df75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Fri, 30 Dec 2022 15:08:29 +0000 Subject: [PATCH] updating github actions --- .github/workflows/firebase-preview.yml | 2 +- .github/workflows/firebase-production.yml | 36 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/firebase-production.yml diff --git a/.github/workflows/firebase-preview.yml b/.github/workflows/firebase-preview.yml index 554fc0b4..8f40a12a 100644 --- a/.github/workflows/firebase-preview.yml +++ b/.github/workflows/firebase-preview.yml @@ -1,4 +1,4 @@ -name: Deploy Preview +name: Deploy Preview to Firebase 'on': pull_request jobs: build_and_preview: diff --git a/.github/workflows/firebase-production.yml b/.github/workflows/firebase-production.yml new file mode 100644 index 00000000..a12b1896 --- /dev/null +++ b/.github/workflows/firebase-production.yml @@ -0,0 +1,36 @@ +name: Deploy Production to Firebase +'on': + push: + branches: + - main +jobs: + build_and_deploy: + 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 ../public --baseURL https://blowfish.page + + - name: Deploy Production + uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BLOWFISH_21FFF }}' + channelId: live + projectId: blowfish-21fff \ No newline at end of file