35 lines
776 B
YAML
35 lines
776 B
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: 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 }}
|
|
docker compose pull
|
|
docker compose up -d |