5
5
branches : [main]
6
6
pull_request :
7
7
workflow_dispatch :
8
+ inputs :
9
+ viteNetworkConfig :
10
+ type : string
11
+ required : false
12
+ default : ' '
13
+ description : VITE Network config to pin. Blank == testing. e.g. netname.agoric.net
8
14
9
15
jobs :
10
- deploy :
16
+ build :
11
17
runs-on : ubuntu-latest
12
- permissions :
13
- pull-requests : write
14
18
steps :
15
19
- name : Checkout
16
20
uses : actions/checkout@v3
17
- - name : Get current date
18
- id : date
19
- run : echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT
20
21
- name : Use Node.js
21
22
uses : actions/setup-node@v3
22
23
with :
23
24
node-version : 18
24
-
25
25
- name : Build
26
26
run : |
27
27
find .
28
28
yarn install
29
+ if [[ "${{ inputs.viteNetworkConfig }}" != "" ]]; then
30
+ export VITE_NETWORK_CONFIG_URL=https://${{ inputs.viteNetworkConfig }}/network-config
31
+ fi
29
32
yarn build
30
-
33
+ - name : Get current date
34
+ id : date
35
+ run : echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT
31
36
- name : Deploy on IPFS
32
37
uses : aquiladev/ipfs-action@12cc5d253735dc2894fe19828bd042c8532acc5d # v0.3.1
33
38
id : ipfs
@@ -38,14 +43,43 @@ jobs:
38
43
filebaseBucket : ${{ secrets.FILEBASE_BUCKET }}
39
44
filebaseKey : ${{ secrets.FILEBASE_KEY }}
40
45
filebaseSecret : ${{ secrets.FILEBASE_SECRET }}
46
+ outputs :
47
+ ipfs : ${{ steps.ipfs.outputs.ipfs }}
48
+
49
+ annotate :
50
+ runs-on : ubuntu-latest
51
+ needs : build
52
+ permissions :
53
+ pull-requests : write
54
+ steps :
41
55
- name : Convert IPFS Hash
42
56
id : ipfsv1
43
57
run : |
44
- echo "v1hash=$(npx --yes [email protected] base32 ${{ steps.ipfs .outputs.ipfs }})" >> $GITHUB_OUTPUT
58
+ echo "v1hash=$(npx --yes [email protected] base32 ${{ needs.build .outputs.ipfs }})" >> $GITHUB_OUTPUT
45
59
- name : Add IPFS info to PR
46
60
uses : mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 # v2
47
61
with :
48
62
message : |
49
- IPFS hash: `${{ steps.ipfs.outputs.ipfs }}`
63
+ Network: ${{ inputs.viteNetworkConfig }}
64
+ Commit: ${{ github.sha }}
65
+ Ref: `${{ github.ref }}`
50
66
IPFS v1 hash: `${{ steps.ipfsv1.outputs.v1hash }}`
51
67
[CF](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.cf-ipfs.com) - [DWeb](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.dweb.link) - [4EVERLAND](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.4everland.io)
68
+ outputs :
69
+ v1hash : ${{ steps.ipfsv1.outputs.v1hash }}
70
+
71
+ release :
72
+ needs : annotate
73
+ runs-on : ubuntu-latest
74
+ permissions :
75
+ contents : write
76
+ steps :
77
+ - uses : softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b
78
+ if : startsWith(github.ref, 'refs/tags/')
79
+ with :
80
+ body : |
81
+ Network: ${{ inputs.viteNetworkConfig }}
82
+ Commit: ${{ github.sha }}
83
+ Ref: `${{ github.ref }}`
84
+ IPFS v1 hash: `${{ needs.annotate.outputs.v1hash }}`
85
+ [CF](https://${{ needs.annotate.outputs.v1hash }}.ipfs.cf-ipfs.com) - [DWeb](https://${{ needs.annotate.outputs.v1hash }}.ipfs.dweb.link) - [4EVERLAND](https://${{ needs.annotate.outputs.v1hash }}.ipfs.4everland.io)
0 commit comments