From c9fd18942f234c18ed1abb151eb0a8c6b2bf7950 Mon Sep 17 00:00:00 2001 From: 0x1a8510f2 Date: Mon, 27 Dec 2021 18:36:43 +0000 Subject: [PATCH 1/2] Initial workflow --- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..3b1a4cb1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +# See: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Build and Deploy (Node.js) + +on: + push: + branches: [ main ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build with Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: '16' + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test + + - name: Upload to IPFS + uses: aquiladev/ipfs-action@v0.1.6 From 7a1a51e41771d7ffa2d2bd813eb10a0bda0c8e87 Mon Sep 17 00:00:00 2001 From: 0x1a8510f2 Date: Tue, 28 Dec 2021 04:14:29 +0000 Subject: [PATCH 2/2] Fixes after testing The action now successfully builds the site and publishes it to IPFS using the pinata service to keep the site pinned, provided valid credentials are supplied. --- .github/workflows/deploy.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3b1a4cb1..345429db 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,14 +12,21 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build with Node.js ${{ matrix.node-version }} + + - name: Build uses: actions/setup-node@v2 with: node-version: '16' cache: 'npm' - run: npm ci - - run: npm run build --if-present - - run: npm test + - run: npm run build:prod - name: Upload to IPFS - uses: aquiladev/ipfs-action@v0.1.6 + uses: anantaramdas/ipfs-pinata-deploy-action@v1.6.4 + with: + pin-name: 'syphon.org' + path: './out' + pinata-api-key: ${{ secrets.PINATA_KEY }} + pinata-secret-api-key: ${{ secrets.PINATA_SECRET }} + verbose: true + remove-old: true