Files
stocksearch/.gitea/workflows/workflows.yaml
hayato5246 31f4516817
Some checks failed
Build Push and Restart Compose / deploy (push) Failing after 1m0s
자동화 개선: Gitea Workflow 수정 - 불필요한 디렉토리 변경 제거 및 Docker Compose 경로 업데이트
2026-04-02 20:31:15 +09:00

43 lines
1.0 KiB
YAML

name: Build Push and Restart Compose
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
IMAGE_NAME: lshfly-registry.duckdns.org/stocksearch:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check secrets
run: |
test -n "${{ secrets.REGISTRY_USERNAME }}" || (echo "REGISTRY_USERNAME is empty" && exit 1)
test -n "${{ secrets.REGISTRY_PASSWORD }}" || (echo "REGISTRY_PASSWORD is empty" && exit 1)
- name: Login to registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login lshfly-registry.duckdns.org \
-u "${{ secrets.REGISTRY_USERNAME }}" \
--password-stdin
- name: Build image
run: |
docker build -t ${IMAGE_NAME} .
- name: Push image
run: |
docker push ${IMAGE_NAME}
- name: Restart compose
run: |
cd /home/opc/programs
docker compose pull
docker compose up -d