Skip to content

Deploy to zettaday (dev) #16

Deploy to zettaday (dev)

Deploy to zettaday (dev) #16

Workflow file for this run

name: Deploy to epsilonday (dev)
on:
# # deploy runs when merging on dev
# pull_request:
# types:
# - closed
# branches:
# - dev
# and can be triggered manually also
workflow_dispatch:
env:
VITE_ENVIRONMENT: dev
VITE_LOGLEVEL: 0
VITE_API_BASE_URL: https://api.zettaday.com/
VITE_X_APP_ID: sBnL0RkWkM
VITE_X_APP_SECRET: 21gPAwU3uOUisMJJFJjaotbDxCmvCHKMh76Xlvb8XK2RkkvZHhtSfcUfoz6QiFx8zhZf31vxvKAFD7pkdmbjHiKwoVuS2iDOLjvC
VITE_ZAPPER_BASE_URL: https://api.zapper.fi/v1/
VITE_ZAPPER_BASE_URL_V2: https://api.zapper.fi/v2/
VITE_COINGECKO_BASE_URL: https://api.coingecko.com/api/v3/
VITE_DEFIPULSE_BASE_URL: https://data-api.defipulse.com/api/v1/
VITE_ETHERSCAN_BASE_URL: https://api.etherscan.io/api
VITE_ULTRA_SOUND_MONEY_BASE_URL: https://api.ultrasound.money/
VITE_SWAP_FEE: 10
VITE_SWAP_FEE_ADDRESS: "0xeb2eCdDF7db14D4Ebca0848F2a879162eb8A43F1"
VITE_GA_MEASUREMENT_ID: ""
VITE_FIRE_PROJECT_ID: gammaday-staging
VITE_FIRE_MEASUREMENT_ID: G-J6KTFT40XV
VITE_ALPHADAY_IPFS_GATEWAY: https://alphaday.infura-ipfs.io/ipfs/
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ !(contains(github.event.pull_request.title, '(skip-ci)')) && (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true) }} # run only if triggered manually or via merged pr
steps:
- uses: actions/checkout@v2
- name: Set tag ENV
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: "18.15.0"
cache: "yarn"
cache-dependency-path: |
yarn.lock
- name: yarn install
run: yarn
- name: build
run: yarn build:deploy
env:
VITE_ENVIRONMENT: ${{ env.ENVIRONMENT }}
VITE_DEFIPULSE_API_KEY: ${{ secrets.STAGING__FRONTEND__API_KEY_DEFIPULSE }}
VITE_ETHERSCAN_API_KEY: ${{ secrets.STAGING__FRONTEND__API_KEY_ETHERSCAN }}
VITE_ETHPLORER_API_KEY: ${{ secrets.STAGING__FRONTEND__API_KEY_ETHPLORER }}
VITE_ZAPPER_API_KEY: ${{ secrets.STAGING__FRONTEND__API_KEY_ZAPPER }}
VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.DEV__REACT_APP_WALLET_CONNECT_PROJECT_ID }}
VITE_FIRE_API_KEY: ${{ secrets.DEV__REACT_APP_FIRE_API_KEY }}
VITE_FIRE_AUTH_DOMAIN: ${{ secrets.DEV__REACT_APP_FIRE_AUTH_DOMAIN }}
VITE_FIRE_STORAGE_BUCKET: ${{ secrets.DEV__REACT_APP_FIRE_STORAGE_BUCKET }}
VITE_FIRE_MESSAGE_SENDER_ID: ${{ secrets.DEV__REACT_APP_FIRE_MESSAGE_SENDER_ID }}
VITE_FIRE_APP_ID: ${{ secrets.DEV__REACT_APP_FIRE_APP_ID }}
NODE_OPTIONS: "--max_old_space_size=4096"
# deploy: sync to s3 and invalidate cloudfront cache
- name: deploy
uses: kefranabg/s3-sync-action@master # https://github.com/kefranabg/s3-sync-action
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER__AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER__SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.DEV__FRONTENDV2__S3_BUCKET }}
DISTRIBUTION_ID: ${{ secrets.DEV__FRONTENDV2__DISTRIBUTION_ID }}
AWS_REGION: "eu-west-1" # optional: defaults to us-east-1
SOURCE_DIR: "dist"
# Get message VARs and Notify team through discord of deployment
notify:
name: Notify
runs-on: ubuntu-latest
needs: deploy
if: needs.deploy.result == 'success'
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Get Repo Name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: "Get Latest Tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
# Notify Discord
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK__OPS_CHANNEL }}
uses: "Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9"
with:
args: "${{ env.REPOSITORY_NAME }}-${{ steps.previoustag.outputs.tag }} (${{ github.event.pull_request.title }}) has been deployed on ${{ env.ENVIRONMENT }}."