From a3a23e78ca08d5301f6ba08c6ea8ade76aa686ba Mon Sep 17 00:00:00 2001 From: Daniel Norman <1992255+2color@users.noreply.github.com> Date: Fri, 28 Feb 2025 16:39:30 +0100 Subject: [PATCH] ci: add workflow to deploy to ipfs (#709) Co-authored-by: Daniel N <2color@users.noreply.github.com> --- .github/workflows/build-and-deploy.yml | 41 ++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 00000000..f3551370 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,41 @@ +name: Build and Deploy to IPFS + +permissions: + contents: read + pull-requests: write + statuses: write +on: + push: + branches: + - main + pull_request: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + outputs: # This exposes the CID output of the action to the rest of the workflow + cid: ${{ steps.deploy.outputs.cid }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build project + run: npm run build + + - uses: ipfs/ipfs-deploy-action@v1 + name: Deploy to IPFS + id: deploy + with: + path-to-deploy: dist + storacha-key: ${{ secrets.STORACHA_KEY }} + storacha-proof: ${{ secrets.STORACHA_PROOF }} + github-token: ${{ github.token }} diff --git a/package.json b/package.json index f583dfdf..24bf807f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "npm run dev", "dev": "vuepress dev src", - "build": "vuepress build src && npm run postbuild", + "build": "NODE_OPTIONS=--openssl-legacy-provider vuepress build src && npm run postbuild", "postbuild": "./scripts/data/index.js", "lint": "prettier --write \"**/*.{json,yaml,md}\" && run-p lint:**", "lint:eslint": "eslint --cache \"**/*.{js,vue}\" --fix",