Skip to content

fix(APP-3649): Add filters/sort, reorganize layout of buttons #3095

fix(APP-3649): Add filters/sort, reorganize layout of buttons

fix(APP-3649): Add filters/sort, reorganize layout of buttons #3095

name: Pull Request WebApp Preview
on:
pull_request:
types:
- labeled
- synchronize
jobs:
webapp-preview:
if: contains(github.event.pull_request.labels.*.name, 'preview')
environment: staging
runs-on: ubuntu-latest
steps:
- name: Find a PR comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: 'WebApp IPFS Hash: '
- name: Delete Comment
uses: actions/github-script@v6
continue-on-error: true
if: steps.fc.outputs.comment-id != 0
with:
script: |
github.rest.issues.deleteComment({
comment_id: ${{ steps.fc.outputs.comment-id }},
owner: context.repo.owner,
repo: context.repo.repo,
})
- name: Checkout code
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Install depdendencies
run: yarn install --pure-lockfile
- name: Lint
run: yarn lint
- name: Build
run: yarn build --mode staging
env:
VITE_REACT_APP_DEPLOY_VERSION: ${{ github.sha }}
VITE_REACT_APP_DEPLOY_ENVIRONMENT: ${{ needs.set-environment.outputs.environment }}
VITE_REACT_APP_ANALYTICS_KEY: ${{ secrets.VITE_REACT_APP_ANALYTICS_KEY }}
VITE_GATEWAY_IPFS_API_KEY: ${{secrets.VITE_GATEWAY_IPFS_API_KEY}}
VITE_ETHERSCAN_API_KEY: ${{secrets.VITE_ETHERSCAN_API_KEY}}
VITE_POLYGONSCAN_API_KEY: ${{secrets.VITE_POLYGONSCAN_API_KEY}}
VITE_GATEWAY_RPC_API_KEY: ${{secrets.VITE_GATEWAY_RPC_API_KEY}}
VITE_GATEWAY_RPC_API_KEY_ALCHEMY: ${{secrets.VITE_GATEWAY_RPC_API_KEY_ALCHEMY}}
VITE_WALLET_CONNECT_PROJECT_ID: ${{secrets.VITE_WALLET_CONNECT_PROJECT_ID}}
VITE_COVALENT_API_KEY: ${{secrets.VITE_COVALENT_API_KEY}}
VITE_SENTRY_DNS: ${{secrets.VITE_SENTRY_DNS}}
VITE_PINATA_CID_VERSION: ${{vars.VITE_PINATA_CID_VERSION}}
VITE_PINATA_GATEWAY: ${{vars.VITE_PINATA_GATEWAY}}
VITE_PINATA_JWT_API_KEY: ${{secrets.VITE_PINATA_JWT_API_KEY}}
- name: Sentry sourcemap
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: yarn sentry:sourcemaps
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: Install Python modules
run: |
pip install --user pyyaml packaging
- name: Install ipfs-cluster-ctl
run: |
wget https://dist.ipfs.io/ipfs-cluster-ctl/v1.0.0/ipfs-cluster-ctl_v1.0.0_linux-amd64.tar.gz
tar xvfz ipfs-cluster-ctl_v1.0.0_linux-amd64.tar.gz
- name: Unpin
if: steps.fc.outputs.comment-id != 0
continue-on-error: true
run: |
COMMENT='${{ steps.fc.outputs.comment-body }}'
IFS=" " read -ra array <<< "$COMMENT"
hash=${array[3]}
./ipfs-cluster-ctl/ipfs-cluster-ctl --basic-auth '${{ secrets.IPFS_BASIC_AUTH }}' --host '${{ secrets.IPFS_HOST }}' pin rm $hash
- name: Pin on IPFS
id: ipfsPin
run: |
ipfsResult="$(./ipfs-cluster-ctl/ipfs-cluster-ctl --basic-auth '${{ secrets.IPFS_BASIC_AUTH }}' --host '${{ secrets.IPFS_HOST }}' add -r './dist/' | tail -1)"
IFS=" " read -ra array <<< "$ipfsResult"
echo "ipfsHash=${array[1]}" >> $GITHUB_OUTPUT
- name: Update the PR comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
WebApp IPFS Hash: ${{ steps.ipfsPin.outputs.ipfsHash }}
WebApp deployed to https://ipfs.eth.aragon.network/ipfs/${{ steps.ipfsPin.outputs.ipfsHash }}/