Skip to content

Commit

Permalink
Add a deploy job to build.yml workflow, triggering it only on push/me…
Browse files Browse the repository at this point in the history
…rge to main
  • Loading branch information
ctmbl committed Oct 25, 2023
1 parent 818092e commit 5e5e802
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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

0 comments on commit 5e5e802

Please sign in to comment.