From bd8490218ecf358b9399a3a682532d8675e03e2b Mon Sep 17 00:00:00 2001 From: David Baker Effendi Date: Fri, 11 Oct 2024 09:39:23 +0200 Subject: [PATCH 1/2] GitHub Pages Deployment Following the latest Hugo docs, created a suitable deployment. --- .github/workflows/gh-pages.yaml | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/gh-pages.yaml diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml new file mode 100644 index 0000000..2fa230d --- /dev/null +++ b/.github/workflows/gh-pages.yaml @@ -0,0 +1,68 @@ +name: GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.135.0 + steps: + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Install Dart Sass + run: sudo snap install dart-sass + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Build with Hugo + env: + # For maximum backward compatibility with Hugo modules + HUGO_ENVIRONMENT: production + HUGO_ENV: production + HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + # --baseURL "https://flatgraph.joern.io/" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./public + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 1502dffafe67d7445627b2f7cf607e1cd67d31fa Mon Sep 17 00:00:00 2001 From: David Baker Effendi Date: Fri, 11 Oct 2024 13:28:05 +0200 Subject: [PATCH 2/2] Target flatgraph subdomain --- .github/workflows/gh-pages.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index 2fa230d..d184064 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -42,8 +42,7 @@ jobs: hugo \ --gc \ --minify \ - --baseURL "${{ steps.pages.outputs.base_url }}/" - # --baseURL "https://flatgraph.joern.io/" + --baseURL "https://flatgraph.joern.io/" - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: