This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
Merge pull request #606 from alchemix-finance/staging #106
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: Pinata CD | |
on: | |
push: | |
branches: [ "prod" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install | |
uses: borales/[email protected] | |
with: | |
cmd: install | |
- name: Make env | |
run: | | |
echo "VITE_DEBUG_MODE="${{secrets.DEBUG_MODE}} >> .env | |
echo "VITE_BLOCKNATIVE_KEY="${{secrets.BLOCKNATIVE_KEY}} >> .env | |
echo "VITE_NETWORK_ID="${{secrets.NETWORK_ID}} >> .env | |
echo "VITE_NETWORK_NAME="${{secrets.NETWORK_NAME}} >> .env | |
echo "VITE_LOCAL_NETWORK_ID="${{secrets.LOCAL_NETWORK_ID}} >> .env | |
echo "VITE_LOCAL_NETWORK_NAME="${{secrets.LOCAL_NETWORK_NAME}} >> .env | |
echo "VITE_LOCAL_NETWORK_URL="${{secrets.LOCAL_NETWORK_URL}} >> .env | |
echo "VITE_ZAPPER_KEY="${{secrets.ZAPPER_KEY}} >> .env | |
echo "VITE_APP_URL="${{secrets.APP_URL}} >> .env | |
- name: Build | |
uses: borales/[email protected] | |
with: | |
cmd: build:gha | |
- name: Upload build artifact | |
uses: actions/[email protected] | |
with: | |
name: production-files | |
path: ./dist | |
deploy: | |
name: Deploy | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch artifact | |
uses: actions/[email protected] | |
with: | |
name: production-files | |
path: ./dist | |
- name: Managa Pinata pin and gateway | |
id: pinata-manager | |
uses: n4n0GH/[email protected] | |
with: | |
path: ./dist | |
secret: ${{secrets.PINATA_SECRET}} | |
key: ${{secrets.PINATA_KEY}} | |
token: ${{secrets.PINATA_TOKEN}} | |
pinName: "Alchemix v2" | |
unpinOld: "true" | |
gatewayName: "alchemix" | |
gatewayId: ${{secrets.PINATA_GATEWAY_ID}} | |
- name: Notify Discord Channel | |
uses: n4n0GH/[email protected] | |
with: | |
webhook: ${{secrets.DISCORD_WEBHOOK}} | |
cid: ${{steps.pinata-manager.outputs.cid}} | |
commit: ${{github.sha}} | |
cleanup: | |
name: Cleanup | |
needs: [ build, deploy ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove artifact | |
uses: GeekyEggo/[email protected] | |
with: | |
name: production-files |