WebApp Deploy #1243
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: WebApp Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'develop' | |
- 'main' | |
jobs: | |
set-environment: | |
runs-on: ubuntu-latest | |
outputs: | |
environment: ${{ steps.envdev.outputs.environment }}${{ steps.envprod.outputs.environment }} | |
steps: | |
- name: Set environment to TESTING REMOVE THIS | |
if: endsWith(github.ref, '/fleek-fixes') | |
id: envdev | |
run: echo "environment=staging" >> $GITHUB_OUTPUT | |
#- name: Set environment to staging | |
# if: endsWith(github.ref, '/develop') | |
# id: envdev | |
# run: echo "environment=staging" >> $GITHUB_OUTPUT | |
- name: Set environment to prod | |
if: endsWith(github.ref, '/main') | |
id: envprod | |
run: echo "environment=production" >> $GITHUB_OUTPUT | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
container: fleek/create-react-app:node-16 | |
needs: [set-environment] | |
if: needs.set-environment.outputs.environment != '' | |
environment: ${{ needs.set-environment.outputs.environment }} | |
steps: | |
- 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: Test | |
run: yarn test | |
- name: Build | |
run: yarn build --mode ${{ needs.set-environment.outputs.environment }} | |
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_ARBISCAN_API_KEY: ${{secrets.VITE_ARBISCAN_API_KEY}} | |
VITE_BASESCAN_API_KEY: ${{secrets.VITE_BASESCAN_API_KEY}} | |
VITE_WALLET_CONNECT_PROJECT_ID: ${{secrets.VITE_WALLET_CONNECT_PROJECT_ID}} | |
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_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: Install Fleek CLI | |
run: npm i -g @fleek-platform/cli | |
- name: Activate Fleek | |
env: | |
FLEEK_FILE: ${{ needs.set-environment.outputs.environment }} | |
run: mv ./.github/fleek/$FLEEK_FILE.json .fleek.json | |
- name: Deploy on Fleek | |
id: deploy | |
run: fleek sites deploy | |
env: | |
FLEEK_TOKEN: ${{ secrets.FLEEK_TOKEN_2 }} | |
FLEEK_PROJECT_ID: ${{ secrets.FLEEK_PROJECT_ID_2 }} | |
- name: Get the Fleek output url | |
run: echo "The Fleek deploy url is ${{ steps.deploy.outputs.deployUrl }}" |