diff --git a/.github/actions/build_website/action.yaml b/.github/actions/build_website/action.yaml new file mode 100644 index 0000000..7bdd754 --- /dev/null +++ b/.github/actions/build_website/action.yaml @@ -0,0 +1,13 @@ +name: Build the website +description: Build the website + +runs: + using: "composite" + steps: + - name: Install the tutorial_web binary + shell: bash + run: /usr/bin/env python3 install.py linux + + - name: Build + shell: bash + run: ./bin/tutorial_web build -i courses -s ./bin/static -o build -b /tutorial_web_content diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9911d8..51a35d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,13 @@ -name: Builds the website (doesn't deploy - only used for checking syntax) +name: Build the website (doesn't deploy - only used for checking syntax) -on: - push +on: [push, pull_request] jobs: - build-deploy: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Install the tutorial_web binary - run: /usr/bin/env python3 install.py linux - # Build the website - - name: Build - run: ./bin/tutorial_web build -i courses -s ./bin/static -o build -b /tutorial_web_content + - name: Checkout + uses: actions/checkout@master + + - name: Build + uses: ./.github/actions/build_website diff --git a/.github/workflows/github_pages_deploy.yml b/.github/workflows/github_pages_deploy.yml index 60fa61b..1e94fb9 100644 --- a/.github/workflows/github_pages_deploy.yml +++ b/.github/workflows/github_pages_deploy.yml @@ -9,14 +9,14 @@ jobs: build-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Install the tutorial_web binary - run: /usr/bin/env python3 install.py linux - # Build the website - - name: Build - run: ./bin/tutorial_web build -i courses -s ./bin/static -o build -b /tutorial_web_content - - name: Deploy - uses: JamesIves/github-pages-deploy-action@4.1.5 - with: - branch: gh-pages - folder: build + - name: Checkout + uses: actions/checkout@master + + - name: Build + uses: ./.github/actions/build_website + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@4.1.5 + with: + branch: gh-pages + folder: build