Build Zola portfolio and publish it on IPFS #76
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish portfolio on IPFS | |
run-name: Build Zola portfolio and publish it on IPFS | |
on: push | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
CID_TO_PIN_PATH: '/tmp/cid_to_pin' | |
steps: | |
- name: Install Zola | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: [email protected] | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Building zola project | |
run: zola build | |
- name: making all relative | |
run: | | |
cd public | |
npx all-relative | |
cd .. | |
- name: Deploy on IPFS | |
run: | | |
cd .deploy && npm install . | |
mv ../public . | |
out=$(node ipfs_deploy.js \ | |
${{ vars.IPFS_RPC_API_SECRET }} \ | |
${{ vars.IPFS_RPC_API_URL }} \ | |
${{ vars.IPFS_RPC_API_NAME_KEY }}) | |
echo $out | tail -n 1 > ${{ env.CID_TO_PIN_PATH }} | |
- name: Update pinned versions on Pinata | |
run: | | |
cid_to_pin=$(cat ${{ env.CID_TO_PIN_PATH }}) | |
node .deploy/pinata_update_pinned.js \ | |
${{ secrets.PINATA_API_KEY }} \ | |
${{ vars.PINATA_PIN_NAME }} \ | |
$cid_to_pin |