From 65fff4ee941de579a6de4d0a32db2fb55d2acbf0 Mon Sep 17 00:00:00 2001 From: Lixquid Date: Sun, 19 May 2024 17:51:27 +0100 Subject: [PATCH] Change to use GitHub Actions / Pages --- .build.yml | 21 ------------------- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 21 deletions(-) delete mode 100644 .build.yml create mode 100644 .github/workflows/build.yml diff --git a/.build.yml b/.build.yml deleted file mode 100644 index 3430bb8..0000000 --- a/.build.yml +++ /dev/null @@ -1,21 +0,0 @@ -# SourceHut Build Manifest -image: alpine/latest -oauth: pages.sr.ht/PAGES:RW -packages: - - nodejs - - yarn - - hut -sources: - - https://github.com/lixquid/node-blog-generator -tasks: - - build: | - cd * - cd blog - git reset --hard origin/master - cd .. - yarn install - yarn build - - package: | - cd */out/dist - tar czvf ../dist.tgz * - hut pages publish -d blog.lixquid.com ../dist.tgz diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ce891a8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build and Deploy +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + # Check out the generator + - uses: "actions/checkout@v2" + with: + name: "lixquid/node-blog-generator" + submodules: true + # Update the generator's blog submodule to the latest commit + - name: "Update blog submodule" + run: "cd node-blog-generator/blog && git reset --hard origin/master" + # Set up Node.js + - name: "Set up Node.js" + uses: "actions/setup-node@v4" + # Install dependencies + - name: "Install dependencies" + run: "yarn install" + # Build + - name: "Build" + run: "yarn build" + # Upload artifact + - name: "Upload artifact" + uses: "actions/upload-pages-artifact@v3" + with: + path: out + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + steps: + - name: "Deploy to GitHub Pages" + uses: "actions/deploy-pages@v4"