-
Notifications
You must be signed in to change notification settings - Fork 21
56 lines (45 loc) · 1.37 KB
/
docker-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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