From 6f48481c6cb83232fb9668e07ca1ceb69d3ec521 Mon Sep 17 00:00:00 2001 From: Moncef AOUDIA Date: Wed, 8 Nov 2023 22:09:14 +0100 Subject: [PATCH] ci: fix some issues --- .github/workflows/build.yml | 14 +++++++++----- .github/workflows/deploy.yml | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5a367d..364ccd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,15 @@ name: Build staging on: push: - branches: - - '**' - pull_request: branches: - main + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + workflow_dispatch: + +env: + COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + BRANCH: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.event.pull_request.head.ref) || github.ref }} jobs: build: @@ -23,12 +27,12 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: ${{ secrets.HUGO_VERSION }} + hugo-version: ${{ vars.HUGO_VERSION }} extended: true env: HUGO_GOOGLEANALYTICS: ${{ secrets.HUGO_GOOGLE }} HUGOxPARAMSxALGOLIA_APPID: ${{ secrets.HUGOXPARAMSXALGOLIA_APPID }} - HUGOxPARAMSxALGOLIA_APIKEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }} + HUGOxPARAMSxALGOLIA_APIKEY: ${{ secrets.HUGOXPARAMSXALGOLIA_APIKEY }} HUGOxPARAMSxALGOLIA_INDEXNAME: ${{ secrets.HUGOXPARAMSXALGOLIA_INDEXNAME }} - name: Setup Ruby diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1c45d03..4afa130 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: jobs: deploy: @@ -20,12 +21,12 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: ${{ secrets.HUGO_VERSION }} + hugo-version: ${{ vars.HUGO_VERSION }} extended: true env: HUGO_GOOGLEANALYTICS: ${{ secrets.HUGO_GOOGLE}} HUGOxPARAMSxALGOLIA_APPID: ${{ secrets.HUGOXPARAMSXALGOLIA_APPID }} - HUGOxPARAMSxALGOLIA_APIKEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }} + HUGOxPARAMSxALGOLIA_APIKEY: ${{ secrets.HUGOXPARAMSXALGOLIA_APIKEY }} HUGOxPARAMSxALGOLIA_INDEXNAME: ${{ secrets.HUGOXPARAMSXALGOLIA_INDEXNAME }} - name: Setup Ruby