Skip to content

bump memory to 1.3.0 (#98) #49

bump memory to 1.3.0 (#98)

bump memory to 1.3.0 (#98) #49

Workflow file for this run

name: Build & Deploy Website
on:
push:
branches:
- main
paths:
- 'client/**'
- 'docs/**'
workflow_dispatch:
jobs:
build:
name: Build Website
runs-on: ubuntu-latest
environment: production
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Setup Caching
uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/client/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Install Dependencies
run: npm ci --workspace=client --include-workspace-root
- name: Run Linters
run: npm run lint:client && npm run lint:style
- name: Build Site
run: npm run build --workspace=client
env:
API_KEY_GITHUB: ${{ secrets.API_KEY_GITHUB }}
NODE_ENV: production
- name: Compress Assets
uses: stefh/ghaction-CompressFiles@v1
with:
path: ./client/dist
depth: 10
extensions: '.css,.html,.js,.svg,.json'
tools: brotli
- name: Create Deployment Tarball
uses: a7ul/[email protected]
with:
command: c
cwd: ./client/dist
files: .
outPath: pictogrammers-client-${{ github.run_id }}.tar.gz
- name: Upload Tarball Artifact
uses: actions/upload-artifact@v3
with:
name: pictogrammers-client-${{ github.run_id }}
path: pictogrammers-client-${{ github.run_id }}.tar.gz
deploy:
needs: build
name: Deploy Website
runs-on: ubuntu-latest
environment: production
steps:
- name: Download Tarball Artifact
uses: actions/download-artifact@v3
with:
name: pictogrammers-client-${{ github.run_id }}
- name: Deploy Tarball to Server
uses: trendyminds/github-actions-rsync@master
with:
RSYNC_OPTIONS: -avzr --delete
RSYNC_TARGET: /opt/${{ secrets.SSH_USER }}/temp
RSYNC_SOURCE: /pictogrammers-client-${{ github.run_id }}.tar.gz
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USERNAME: ${{ secrets.SSH_USER }}
SSH_HOSTNAME: ${{ secrets.SSH_HOST }}
- name: Expand Tarball
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
tar -zxf /opt/${{ secrets.SSH_USER }}/temp/pictogrammers-client-${{ github.run_id }}.tar.gz -C /opt/${{ secrets.SSH_USER }}/pictogrammers --recursive-unlink
rm /opt/${{ secrets.SSH_USER }}/temp/pictogrammers-client-${{ github.run_id }}.tar.gz