From 1375a498f6cf56e5cb9e2396033eba7331ec0983 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 14:54:01 -0600 Subject: [PATCH 1/7] don't install dart --- .github/workflows/deploy-to-neocities.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index e06ea3d..d680ffb 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -26,8 +26,6 @@ jobs: 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: From 56755531bf1c16c70df01e4881fba8f1941da389 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 14:58:23 -0600 Subject: [PATCH 2/7] use setup-hugo action --- .github/workflows/deploy-to-neocities.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index d680ffb..2343127 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -19,13 +19,12 @@ jobs: build: name: Build Hugo site runs-on: ubuntu-latest - env: - HUGO_VERSION: "0.121.1" 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: Hugo setup + uses: peaceiris/actions-hugo@v2.6.0 + with: + hugo-version: '0.121.1' + extended: true - name: Checkout uses: actions/checkout@v4 with: From dc6618b949b0bd8f8b9dfce3b67c87db74a6fa64 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 15:12:41 -0600 Subject: [PATCH 3/7] collapse hugo command line --- .github/workflows/deploy-to-neocities.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index 2343127..be497ec 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -36,9 +36,7 @@ jobs: # For maximum backward compatibility with Hugo modules HUGO_ENVIRONMENT: production HUGO_ENV: production - run: | - hugo \ - --minify + run: hugo --minify - name: Insert 404 page run: | cp public/not_found/index.html public/not_found.html From dd2aa6c251a657e69ea352eb0b294c86d74d1a30 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 15:14:51 -0600 Subject: [PATCH 4/7] remove unneeded hugo vars --- .github/workflows/deploy-to-neocities.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index be497ec..f13960c 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -32,10 +32,6 @@ jobs: - 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 run: hugo --minify - name: Insert 404 page run: | From 298f44fad1e8d7fcb34f92292390dfe771b6355a Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 15:27:40 -0600 Subject: [PATCH 5/7] remove unneeded node dependencies steps --- .github/workflows/deploy-to-neocities.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index f13960c..69f9d70 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -29,8 +29,6 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Install Node.js dependencies - run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" - name: Build with Hugo run: hugo --minify - name: Insert 404 page @@ -52,8 +50,6 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Install Node.js dependencies - run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" - name: Download artifact uses: actions/download-artifact@v4 with: From c3a87223695d7e90ce097adca5de8756f67decff Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 15:29:49 -0600 Subject: [PATCH 6/7] collapse workflow to single job --- .github/workflows/deploy-to-neocities.yml | 42 ++--------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index 69f9d70..2f498c9 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -16,8 +16,8 @@ defaults: shell: bash jobs: - build: - name: Build Hugo site + deploy: + name: Build and deploy Hugo site runs-on: ubuntu-latest steps: - name: Hugo setup @@ -34,48 +34,10 @@ jobs: - name: Insert 404 page run: | cp public/not_found/index.html public/not_found.html - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: build - path: public - retention-days: 1 - - highlight: - name: Highlight code with Torchlight - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: build - path: public - name: Highlight with Torchlight run: | npm i @torchlight-api/torchlight-cli npx torchlight - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: highlight - path: public - retention-days: 1 - - deploy: - name: Publish to Neocities - runs-on: ubuntu-latest - needs: highlight - steps: - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: highlight - path: public - name: Deploy to neocities uses: bcomnes/deploy-to-neocities@v1 with: From c40f37d1d527e18f1f8e499d0ac2c9e01d01b42f Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 21 Jan 2024 15:31:14 -0600 Subject: [PATCH 7/7] prune orphans --- .github/workflows/deploy-to-neocities.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-neocities.yml b/.github/workflows/deploy-to-neocities.yml index 2f498c9..069f6af 100644 --- a/.github/workflows/deploy-to-neocities.yml +++ b/.github/workflows/deploy-to-neocities.yml @@ -38,9 +38,9 @@ jobs: run: | npm i @torchlight-api/torchlight-cli npx torchlight - - name: Deploy to neocities + - name: Deploy to Neocities uses: bcomnes/deploy-to-neocities@v1 with: api_token: ${{ secrets.NEOCITIES_API_TOKEN }} - cleanup: false + cleanup: true dist_dir: public \ No newline at end of file