-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (53 loc) · 1.97 KB
/
main.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
57
58
59
60
61
62
name: redive linebot CI
on:
push:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Backend build and push Docker image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
context: ./app
push: true
tags: hanshino/redive_backend:latest
cache-from: type=registry,ref=hanshino/redive_backend:buildcache
cache-to: type=registry,ref=hanshino/redive_backend:buildcache,mode=max
- name: Frontend build and push Docker image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
with:
context: ./frontend
push: true
tags: hanshino/redive_frontend:latest
cache-from: type=registry,ref=hanshino/redive_frontend:buildcache
cache-to: type=registry,ref=hanshino/redive_frontend:buildcache,mode=max
build-args: |
REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}
- name: Deploy Redive linebot
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ${{ secrets.DEPLOY_PATH }}
git pull
bash scripts/run-tasks.sh traefik-run
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "{{ EVENT_PAYLOAD.repository.full_name }} 已完成部署"