-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.28 KB
/
github-actions-demo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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