From b759f1c3817af750c21cf706c1826e5127f1aec8 Mon Sep 17 00:00:00 2001 From: ctmbl Date: Wed, 25 Oct 2023 09:38:41 +0200 Subject: [PATCH] Add a deploy job to build.yml workflow, triggering it only on push/merge to main --- .github/workflows/build.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1988c52..f2f4961 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,13 @@ -name: Build HUGO website +name: Build and deploy HUGO website on: # Runs on pull requests to check that the website is building without errors pull_request: + # Runs on push/merge to main to deploy the new website + push: + branches: [main] + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -29,3 +33,17 @@ jobs: with: name: build path: ./build/blog + + deploy: + needs: [build] + if: ${{ github.event_name == 'push' }} + runs-on: ubuntu-latest + steps: + - name: 🛠️ Setup build directory + run: | + mkdir -p build/blog + - name: 📥 Download build Artifacts + uses: actions/download-artifact@v3 + with: + name: build + path: build/blog