ci: sequence ci actions #36
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: "Deploy and Pin" | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
jobs: | |
test: | |
uses: "./.github/workflows/tests.yml" | |
deploy: | |
needs: "test" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Setup: checkout the repo" | |
uses: "actions/checkout@v3" | |
- name: "Dependencies: setup node" | |
uses: "actions/setup-node@v3" | |
with: | |
cache: "yarn" | |
node-version: "lts/*" | |
- name: "Dependencies: install" | |
run: "yarn install --immutable" | |
- name: "List: build project" | |
run: "yarn build" | |
- name: "IPFS: upload bundle and pin" | |
id: upload | |
uses: aquiladev/ipfs-action@master | |
with: | |
path: "build/sablier-community.tokenlist.json" | |
service: "infura" | |
pinName: "tokenlist" | |
infuraProjectId: ${{ secrets.INFURA_PROJECT_ID }} | |
infuraProjectSecret: ${{ secrets.INFURA_PROJECT_SECRET }} | |
- name: "IPFS: hash summary" | |
run: | | |
echo "Successfully deployed on IPFS: [${{ steps.upload.outputs.hash }}](https://cloudflare-ipfs.com/ipfs/${{ | |
steps.upload.outputs.hash }})" | |
- name: "Cloudflare: update DNS with latest IPFS hash" | |
env: | |
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | |
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | |
CLOUDFLARE_GATEWAY_ID: ${{ secrets.CLOUDFLARE_GATEWAY_ID }} | |
uses: sablier-labs/action-cloudflare-web3-gateway@main | |
with: | |
cid: ${{ steps.upload.outputs.hash }} |