Revert "Revert "Rework build system" due to base url bug" (#8) #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build-lists: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: build | |
run: make build_hostfiles | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/Hosts | |
name: Hosts | |
# Build job | |
build-site: | |
needs: build-lists | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: pages | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Download Resources | |
uses: actions/download-artifact@v4 | |
with: | |
name: Hosts | |
path: pages/resources/Hosts | |
- name: Make Resource List | |
working-directory: ./pages | |
run: make generate | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./pages | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
# Deployment job | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build-site | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |