Skip to content

build(deps): update axios to ^0.29.0 #355

build(deps): update axios to ^0.29.0

build(deps): update axios to ^0.29.0 #355

Workflow file for this run

# GitHub Actions References:
# https://docs.github.com/en/actions
name: ⚙🚀
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]
jobs:
test_build:
name: ⚛ Test and Build ⚙
strategy:
matrix:
os: [ubuntu-latest]
node: [17.x, "lts/*"]
runs-on: ${{ matrix.os }}
steps:
- name: 🛑 Cancel Previous Running Workflows
uses: styfle/[email protected]
- name: 🛎️ Checkout
uses: actions/[email protected]
- name: 📦 Use Node.js ${{ matrix.node }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
cache: yarn
cache-dependency-path: "**/yarn.lock"
- name: ✨ Install Dependencies
run: yarn --immutable --check-cache
- name: 👓 Run Linter
run: yarn lint
- name: 💅 Run Formatter
run: yarn format
- name: 🧪 Run Tests
run: yarn test
- name: 🛠 Run Build
run: yarn build
- name: ♻ Cache dist Directory for Publish
uses: actions/[email protected]
with:
path: |
./.yarn
./.yarnrc.yml
./dist
./package.json
./pm2.yml
./tsconfig-paths-bootstrap.js
./tsconfig.json
./yarn.lock
key: ${{ github.sha }}-${{ runner.os }}-${{ matrix.node }}
deploy:
name: 🚀 Deploy to Production ✨
needs: test_build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
matrix:
os: [ubuntu-latest]
node: ["lts/*"]
runs-on: ${{ matrix.os }}
steps:
- name: 🛑 Cancel Previous Running Workflows
uses: styfle/[email protected]
- name: ⚙ Configure SSH
env:
SSH_USER: ${{ secrets.PRODUCTION_SSH_USER }}
SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }}
SSH_PORT: ${{ secrets.PRODUCTION_SSH_PORT }}
SSH_KEY: ${{ secrets.PRODUCTION_SSH_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/production.key
chmod 600 ~/.ssh/production.key
cat <<EOF >~/.ssh/config
Host production
HostName $SSH_HOST
User $SSH_USER
Port $SSH_PORT
IdentityFile ~/.ssh/production.key
BatchMode yes
StrictHostKeyChecking no
EOF
- name: ♻ Restore dist Directory for Publish
id: restore-dist
uses: actions/[email protected]
with:
path: |
./.yarn
./.yarnrc.yml
./dist
./package.json
./pm2.yml
./tsconfig-paths-bootstrap.js
./tsconfig.json
./yarn.lock
key: ${{ github.sha }}-${{ runner.os }}-${{ matrix.node }}
- name: 🌏 Setup Remote Host ENV
env:
DISCORD_TOKEN: ${{ secrets.PRODUCTION_DISCORD_TOKEN }}
DB_URI: ${{ secrets.PRODUCTION_DB_URI }}
run: |
cat <<EOF >./.env
NODE_ENV=production
DISCORD__BOT_TOKEN=$DISCORD_TOKEN
DB_URI=$DB_URI
PREFIX=
EOF
- name: 🆙 Upload Build State to Remote Host
run: rsync -rltDvzOh --delete ./ production:${{ secrets.PRODUCTION_SSH_PATH }}
- name: ✨ Install Dependencies in Remote Host
run: ssh production 'cd ${{ secrets.PRODUCTION_SSH_PATH }} && yarn workspaces focus --all --production'
- name: 🐥 Run Emperor Ruppy
run: ssh production 'if pm2 describe emperor-ruppy; then pm2 restart emperor-ruppy; else cd ${{ secrets.PRODUCTION_SSH_PATH }} && yarn start; fi'