on:
  push:
    branches:
    - master
jobs:
  up:
    name: "CD > 啟動服務"
    runs-on: ct-docker
    steps:
    - name: 取得專案
      uses: actions/checkout@v4
    - name: 啟動 Traefik
      run: cd "${{ gitea.workspace }}/traefik" && docker compose up -d --build
    - name: 啟動 Socket CAT
      run: cd "${{ gitea.workspace }}/socat" && docker compose up -d
    - name: 重新啟動 Traefik
      run: cd "${{ gitea.workspace }}/traefik" && docker compose restart
  clear:
    name: "CD > 清理資源"
    runs-on: ct-docker
    needs: up
    steps:
    - name: 清理資源
      run: docker system prune -af --volumes