Skip to content

Merge pull request #412 from hanshino/snyk-upgrade-c27f24d9a6b060a6cb… #285

Merge pull request #412 from hanshino/snyk-upgrade-c27f24d9a6b060a6cb…

Merge pull request #412 from hanshino/snyk-upgrade-c27f24d9a6b060a6cb… #285

Workflow file for this run

name: redive linebot CI
on:
push:
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Backend build and push Docker image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
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@2eb1c1961a95fc15694676618e422e8ba1d63825
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@v0.1.10
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 }} 已完成部署"