Files
stocksearch/.gitea/workflows/workflows.yaml
Oracle Public Cloud User c35208e1ce
Some checks failed
Build Push and Restart Compose / deploy (push) Failing after 1m6s
update workflow
2026-04-02 03:57:01 +00:00

49 lines
1.2 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 /workspace/${{ gitea.repository }}
pwd
ls -la
- name: Restart compose
run: |
cd /workspace/${{ gitea.repository }}
docker compose pull
docker compose up -d