Skip to content

Update error code

Update error code #806

Workflow file for this run

name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run linter πŸ‘€
run: pnpm run check:lint
- name: Run prettier 🧹
run: pnpm run check:format
- name: Run typecheck βœ…
run: pnpm run check:type
- name: Build 😎
run: pnpm run build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
unittest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: latest
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run unit tests πŸ§ͺ
run: pnpm run test:unit
build-docker-image:
needs: unittest
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Read image identifiers
id: image
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Build image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ steps.image.outputs.lowercase }}:latest
ghcr.io/${{ steps.image.outputs.lowercase }}:${{ github.sha }}
build-args: |
- RELEASE=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
needs: build-docker-image
runs-on: ubuntu-latest
steps:
- name: Read image identifiers
id: image
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Update production image
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.DEPLOY_HOST }}
username: circle
key: ${{ secrets.DEPLOY_KEY }}
script: docker service update app_lms --image ghcr.io/${{ steps.image.outputs.lowercase }}:${{ github.sha }} --with-registry-auth