Skip to content

9 available pools table #127

9 available pools table

9 available pools table #127

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
working-directory: ${{ github.workspace }}/frontend
run: yarn install --frozen-lockfile
- name: Load environment variables
run: |
echo "${{ secrets.ENV_VARIABLES }}" > .env
echo VITE_REACT_APP_GIT_TAG=${{ github.ref_name }} >> .env
echo VITE_REACT_APP_GIT_DATE="$(git log -1 --format=%cd)" >> .env
- name: ESlint check
working-directory: ${{ github.workspace }}/frontend
run: yarn lint
- name: Build with Vite
working-directory: ${{ github.workspace }}/frontend
run: yarn build
- name: Put Git tag and time to .env file
run: |
echo VITE_REACT_APP_GIT_TAG=${{ github.ref_name }} > ${{ github.workspace }}/frontend/dist/.env
echo VITE_REACT_APP_GIT_DATE="$(date +'%Y-%m-%d')" >> ${{ github.workspace }}/frontend/dist/.env
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ethonline-2023-build-${{ github.run_id }}
path: ${{ github.workspace }}/frontend/dist/
deploy:
name: Deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
env:
SCRIPT_NAME: 'deploy-dev.sh'
needs: build
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Compress Build Artifact
run: tar -czf ethonline-2023-build-${{ github.run_id }}.tgz ./ethonline-2023-build-${{ github.run_id }}/*
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Copy artifact to server
run: scp ./ethonline-2023-build-${{ github.run_id }}.tgz ${{ secrets.USERNAME }}@${{ secrets.HOST }}:${{ secrets.BUILDS_PATH }}
- name: Restart deployed build
run: ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "/home/${{ secrets.USERNAME }}/${{ env.SCRIPT_NAME }} ${{ github.run_id }}"