🎉 version(architecture): v0.3 #150
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/CD | |
on: | |
push: | |
branches: ['master'] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: install pnpm | |
run: npm install -g pnpm | |
- name: pnpm install | |
run: pnpm install | |
- name: build @apps/admin | |
run: pnpm --filter @apps/admin... build | |
- name: build @apps/micro | |
run: pnpm --filter @apps/micro... build | |
- name: build @apps/micro-docs | |
run: pnpm --filter @apps/micro-docs... build | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push the Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./.github/workflows/Dockerfile | |
push: true | |
tags: tingcode/web-admin:latest | |
- name: ssh docker login | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
script: sh web_admin.sh |