Merge pull request #526 from hanshino:feature/attack-message #377
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: 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@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Backend build and push Docker image | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 | |
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@5cd11c3a4ced054e52742c5fd54dca954e0edd85 | |
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 }} 已完成部署" |