From 2aeb73370a7d4fd18248897e58b35f929a5e2c5c Mon Sep 17 00:00:00 2001 From: Jugger Date: Wed, 4 Jan 2023 16:04:23 -0600 Subject: [PATCH] feat: setup github action to run on new server * feat: static site * feat: mui support & basic theming * feat: entgamers favicon * feat: public images until dynamic content can be used * feat: entgamers & gaming assets * feat: eslint extra rules * feat: mui theme modifications * feat: fontawesome, gsap, bundle analyzer * feat: common interfaces * feat: basic layout * chore: upadted dependencies * chore: updated dependencies * feat: updated link styles * feat: layout now have better interfaces * feat: basic seo component * feat: static website * feat: env variable rules in .gitignore * feat: added lint to pre-commit * docs: initial documentation * ci: deploy using pm2 * ci: pm2 configuration file * ci: github action deploy preview * ci: github action deploy production * ci: env variables now pass to pm2 * fix: pass environment to actions * feat: post deploy as sudo * fix: pass only required env to deploy * revert: deploy as sudo Refs: 624b225 * fix: server use isomorphic-fetch * ci: use yarn instead npm * fix: glass text contrast * fix: production git ref * docs: deploy env vars * feat: setup github action to run on new server * fix: github action naming * fix: github action name, wrong triggers --- .github/workflows/setup-preview.yml | 41 ++++++++++++++++++++++++++ .github/workflows/setup-production.yml | 41 ++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/setup-preview.yml create mode 100644 .github/workflows/setup-production.yml diff --git a/.github/workflows/setup-preview.yml b/.github/workflows/setup-preview.yml new file mode 100644 index 0000000..9d28d61 --- /dev/null +++ b/.github/workflows/setup-preview.yml @@ -0,0 +1,41 @@ +name: CI setup preview +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + environment: preview + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v2 + with: + node-version: "16" + - name: Setup Host SSH + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + chmod 600 ~/.ssh/known_hosts + shell: bash + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} + - name: Install pm2 + run: npm install pm2 --location=global + shell: bash + - name: Deploy using pm2 + run: pm2 deploy ecosystem.config.js preview setup + env: + # Deploy environment variables + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + SSH_USERNAME: ${{ secrets.SSH_USERNAME }} + SSH_HOST: ${{ secrets.SSH_HOST }} + DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} + # App environment variables + APP_NAME: ${{ secrets.APP_NAME }} + SITE_NAME: ${{ secrets.SITE_NAME }} + PORT: ${{ secrets.PORT }} + DISCORD_JOIN_WEBHOOK_URL: ${{ secrets.DISCORD_JOIN_WEBHOOK_URL }} + shell: bash diff --git a/.github/workflows/setup-production.yml b/.github/workflows/setup-production.yml new file mode 100644 index 0000000..71012b8 --- /dev/null +++ b/.github/workflows/setup-production.yml @@ -0,0 +1,41 @@ +name: CI setup production +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v2 + with: + node-version: "16" + - name: Setup Host SSH + run: | + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + chmod 600 ~/.ssh/known_hosts + shell: bash + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} + - name: Install pm2 + run: npm install pm2 --location=global + shell: bash + - name: Deploy using pm2 + run: pm2 deploy ecosystem.config.js production setup + env: + # Deploy environment variables + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + SSH_USERNAME: ${{ secrets.SSH_USERNAME }} + SSH_HOST: ${{ secrets.SSH_HOST }} + DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} + # App environment variables + APP_NAME: ${{ secrets.APP_NAME }} + SITE_NAME: ${{ secrets.SITE_NAME }} + PORT: ${{ secrets.PORT }} + DISCORD_JOIN_WEBHOOK_URL: ${{ secrets.DISCORD_JOIN_WEBHOOK_URL }} + shell: bash