chore(deps): update dependency eslint-plugin-prettier to v5 #523
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- deploy | |
pull_request: | |
branches: | |
- '**' | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
install: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: "yarn" | |
- name: Restore node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- run: yarn install --immutable | |
lint: | |
needs: [install] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: "yarn" | |
- name: Restore node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- run: yarn run lint | |
build: | |
needs: [install] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: "yarn" | |
- name: Restore node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- run: yarn build | |
- run: tar -cv .yarn/ dist/ .yarnrc.yml package.json yarn.lock | gzip -v -9 > dist-${{ github.sha }}.tar.gz | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-${{ github.sha }} | |
path: dist-${{ github.sha }}.tar.gz | |
build_docker: | |
if: ${{ false }} | |
needs: [install] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: false | |
load: true | |
tags: ghcr.io/${{ github.repository }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Export Docker image | |
run: docker image save -o image.tar ghcr.io/${{ github.repository }} | |
- name: Cache docker image | |
uses: actions/cache@v3 | |
with: | |
path: image.tar | |
key: image-${{ github.sha }} | |
test: | |
needs: [install] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: "yarn" | |
- name: Restore node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- run: yarn run test | |
- uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false | |
verbose: true | |
deploy: | |
needs: [install, lint, build, test] | |
runs-on: ubuntu-22.04 | |
if: ${{ github.event_name == 'push' && ( github.ref_name == 'deploy' || github.ref_name == 'master' ) }} | |
environment: production | |
env: | |
SHA: ${{ github.sha }} | |
steps: | |
- name: Download build artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist-${{ github.sha }} | |
- uses: appleboy/scp-action@8a92fcdb1eb4ffbf538b2fa286739760aac8a95b | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
source: dist-${{ github.sha }}.tar.gz | |
target: /opt/enmon-middleman | |
- uses: appleboy/ssh-action@4a03da89e5c43da56e502053be4bbcb293411883 | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
envs: SHA | |
command_timeout: 20m | |
script_stop: true | |
script: | | |
cd /opt/enmon-middleman | |
echo "Stopping service" | |
sudo systemctl stop enmon-middleman | |
echo "Removing old build" | |
rm -rf dist | |
echo "Extracting new build" | |
mkdir dist | |
tar -xvz -f dist-$SHA.tar.gz | |
echo "Removing build artifact" | |
rm -f dist-$SHA.tar.gz | |
echo "Installing dependencies" | |
yarn workspaces focus --all --production | |
echo "Restarting service" | |
sudo systemctl restart enmon-middleman |