Skip to content

Commit

Permalink
simplify page build
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed Mar 1, 2024
1 parent a052209 commit d1b0752
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@ env:
TARGET_BRANCH: "gh-pages"
CNAME: "coderefinery.org"

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install zola
Expand All @@ -51,20 +60,8 @@ jobs:
echo -n ${{ env.CNAME }} > public/CNAME
echo "Used CNAME from the action workflow file"
fi
- name: Debug info
env:
event_name: ${{ github.event_name }}
ref: ${{ github.ref }}
run: |
echo event_name: "${event_name}"
echo github.ref: "${ref}"
- name: multipages
uses: rkdarst/gh-pages-multibranch@main
if: ${{ github.event_name == 'push' }}
with:
directory: public
- name: Deploy to gh-pages
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', env.MAIN_BRANCH) }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit d1b0752

Please sign in to comment.