-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (48 loc) · 1.81 KB
/
ipfs.yml
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: build and deploy
on:
- push
- pull_request
env:
ENS_NAME: ${{ vars.ENS_NAME }}
NFT_STORAGE_API_TOKEN: ${{ secrets.NFT_STORAGE_API_TOKEN }}
DWEBSERVICE_API_TOKEN: ${{ secrets.DWEBSERVICE_API_TOKEN }}
DWEBSERVICE_UUID: ${{ secrets.DWEBSERVICE_UUID }}
jobs:
build_and_deploy:
if: github.ref == 'refs/heads/public'
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: build
run: pnpm build
# - name: deploy web
# id: cid
# run: pnpm run --filter ./web deploy >> "$GITHUB_OUTPUT"
- name: install deployment tool
run: pnpm add -g [email protected]
- name: deploy to ipfs
id: cid
run: upload-to-ipfs web/build >> "$GITHUB_OUTPUT"
- name: echo CID
run: 'echo "Here is the URL: https://${{ steps.cid.outputs.CID }}.ipfs.dweb.link"'
- name: echo ENS_NAME
run: 'echo "name: $ENS_NAME"'
- name: IPNS update
if: ${{ ! env.DWEBSERVICE_UUID }}
run: 'curl -X "GET" "https://dwebservices.xyz/api/eth-names-ipns/$ENS_NAME/publish_by_name/${{ steps.cid.outputs.CID }}/" -H "accept: application/json" -H "Authorization: Bearer $DWEBSERVICE_API_TOKEN"'
- name: IPNS update
if: ${{ env.DWEBSERVICE_UUID }}
run: 'curl -X "GET" "https://dwebservices.xyz/api/eth-names-ipns/$DWEBSERVICE_UUID/publish/${{ steps.cid.outputs.CID }}/" -H "accept: application/json" -H "Authorization: Bearer $DWEBSERVICE_API_TOKEN"'