537eab4c0d
CI / changes (push) Successful in 35s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 0s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 0s
CI / log (push) Successful in 0s
CI / product (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: CD Test
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
- CI
|
|
types:
|
|
- completed
|
|
branches:
|
|
- develop
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
if: ${{ gitea.event_name == 'workflow_dispatch' || gitea.event.workflow_run.conclusion == 'success' }}
|
|
runs-on: runner
|
|
|
|
defaults:
|
|
run:
|
|
shell: sh
|
|
|
|
steps:
|
|
- name: Login Registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ vars.REGISTRY }} \
|
|
-u "${{ vars.REGISTRY_USERNAME }}" \
|
|
--password-stdin
|
|
|
|
- name: Sync Host Repo
|
|
working-directory: /data/www/lone-services
|
|
run: |
|
|
git fetch origin develop
|
|
git pull origin develop
|
|
|
|
- name: Pull and Deploy
|
|
working-directory: /data/www/lone-services/deploy
|
|
run: |
|
|
docker pull ${{ vars.REGISTRY }}/lone/bff:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/product:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/admin:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/user:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/ad:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/chore:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/express:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/sale:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/equipment:latest
|
|
docker pull ${{ vars.REGISTRY }}/lone/lonelog:latest
|
|
docker compose up -d
|