Skip to content

Merge pull request #360 from Agoric/pc/fix-artifact-url #834

Merge pull request #360 from Agoric/pc/fix-artifact-url

Merge pull request #360 from Agoric/pc/fix-artifact-url #834

Workflow file for this run

name: Deploy dapp-inter to IPFS
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
viteNetworkConfig:
type: string
required: false
default: ''
description: VITE Network config to pin. Blank == testing. e.g. netname.agoric.net
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build
run: |
find .
yarn install
if [[ "${{ inputs.viteNetworkConfig }}" != "" ]]; then
export VITE_NETWORK_CONFIG_URL=https://${{ inputs.viteNetworkConfig }}/network-config
fi
yarn build
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT
- name: Deploy on IPFS
uses: aquiladev/ipfs-action@12cc5d253735dc2894fe19828bd042c8532acc5d #v0.3.1
id: ipfs
with:
path: ./dist
service: filebase
pinName: 'dapp-inter-testing-${{ steps.date.outputs.date }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}'
filebaseBucket: ${{ secrets.FILEBASE_BUCKET }}
filebaseKey: ${{ secrets.FILEBASE_KEY }}
filebaseSecret: ${{ secrets.FILEBASE_SECRET }}
outputs:
ipfs: ${{ steps.ipfs.outputs.ipfs }}
annotate:
runs-on: ubuntu-latest
needs: build
permissions:
pull-requests: write
steps:
- name: Convert IPFS Hash
id: ipfsv1
run: |
echo "v1hash=$(npx --yes cid-tool@3.0.0 base32 ${{ needs.build.outputs.ipfs }})" >> $GITHUB_OUTPUT
- name: Add IPFS info to PR
uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 #v2
with:
message: |
Network: ${{ inputs.viteNetworkConfig }}
Commit: ${{ github.sha }}
Ref: `${{ github.ref }}`
IPFS v1 hash: `${{ steps.ipfsv1.outputs.v1hash }}`
[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)
outputs:
v1hash: ${{ steps.ipfsv1.outputs.v1hash }}