feat: APP-2797 - Implement TransactionDataListItem.Structure module component #514
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: Storybook Preview Deploy | |
on: | |
pull_request: | |
types: | |
- labeled | |
- synchronize | |
env: | |
NODE_VERSION: 18 | |
NODE_CACHE: "yarn" | |
jobs: | |
deploy-preview: | |
if: contains(github.event.pull_request.labels.*.name, 'preview') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Setup Node | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: ${{ env.NODE_CACHE }} | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build storybook | |
run: yarn build:storybook | |
- name: Get previous deployment | |
uses: peter-evans/[email protected] | |
id: get-deployment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body-includes: "Storybook IPFS Hash: " | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.x" | |
architecture: "x64" | |
- name: Install pyyaml | |
run: pip install --user pyyaml packaging | |
- name: Install ipfs-cluster-ctl | |
run: | | |
wget https://dist.ipfs.tech/ipfs-cluster-ctl/v1.0.6/ipfs-cluster-ctl_v1.0.6_linux-amd64.tar.gz | |
tar xvfz ipfs-cluster-ctl_v1.0.6_linux-amd64.tar.gz | |
- name: Unpin from IPFS | |
continue-on-error: true | |
if: steps.get-deployment.outputs.comment-id != 0 | |
run: | | |
COMMENT='${{ steps.get-deployment.outputs.comment-body }}' | |
IFS=" " read -ra array <<< "$COMMENT" | |
hash=${array[3]} | |
./ipfs-cluster-ctl/ipfs-cluster-ctl --basic-auth '${{ secrets.IPFS_BASIC_AUTH }}' --host '${{ vars.IPFS_HOST_ADDRESS }}' pin rm $hash | |
- name: Pin on IPFS | |
id: ipfs-pin | |
run: | | |
ipfsResult="$(./ipfs-cluster-ctl/ipfs-cluster-ctl --basic-auth '${{ secrets.IPFS_BASIC_AUTH }}' --host '${{ vars.IPFS_HOST_ADDRESS }}' -s add -r './storybook-static' | tail -1)" | |
IFS=" " read -ra array <<< "$ipfsResult" | |
echo "hash=${array[1]}" >> $GITHUB_OUTPUT | |
- name: Echo url | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
comment-id: ${{ steps.get-deployment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
edit-mode: replace | |
body: | | |
Storybook IPFS Hash: ${{ steps.ipfs-pin.outputs.hash }} | |
ODS deployed to https://ipfs.eth.aragon.network/ipfs/${{ steps.ipfs-pin.outputs.hash }}/ |