mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2025-04-05 01:21:27 +08:00
Update .yml files
This commit is contained in:
parent
29ba67dc7a
commit
aa221e3382
2 changed files with 25 additions and 23 deletions
|
@ -4,15 +4,6 @@ labels:
|
|||
steps:
|
||||
- name: build
|
||||
image: docker
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
commands:
|
||||
- docker build -t "$REGISTRY_IMAGE_TAG" .
|
||||
- echo "$FORGEJO_REGISTRY_PASSWORD" | docker login "$FORGEJO_REGISTRY_URL" --password-stdin -u "$FORGEJO_REGISTRY_USERNAME"
|
||||
- docker push "$REGISTRY_IMAGE_TAG"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
FORGEJO_REGISTRY_URL:
|
||||
from_secret: FORGEJO_REGISTRY_URL
|
||||
|
@ -22,3 +13,13 @@ steps:
|
|||
from_secret: FORGEJO_REGISTRY_PASSWORD
|
||||
REGISTRY_IMAGE_TAG:
|
||||
from_secret: REGISTRY_IMAGE_TAG
|
||||
commands:
|
||||
- docker build -t "$REGISTRY_IMAGE_TAG" .
|
||||
- echo "$FORGEJO_REGISTRY_PASSWORD" | docker login "$FORGEJO_REGISTRY_URL" --password-stdin -u "$FORGEJO_REGISTRY_USERNAME"
|
||||
- docker push "$REGISTRY_IMAGE_TAG"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
steps:
|
||||
- name: deploy
|
||||
image: alpine:3.20
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
environment:
|
||||
SSH_HOST:
|
||||
from_secret: SSH_HOST
|
||||
PROJECT_DIRECTORY:
|
||||
from_secret: PROJECT_DIRECTORY
|
||||
WOODPECKER_SSH_KEY:
|
||||
from_secret: WOODPECKER_SSH_KEY
|
||||
REGISTRY_IMAGE_TAG:
|
||||
from_secret: REGISTRY_IMAGE_TAG
|
||||
DOCKER_DB_VOLUME:
|
||||
from_secret: DOCKER_DB_VOLUME
|
||||
commands:
|
||||
- apk add openssh
|
||||
- mkdir -p /root/.ssh/
|
||||
|
@ -18,17 +26,10 @@ steps:
|
|||
docker pull "$REGISTRY_IMAGE_TAG";
|
||||
docker-compose up -d;
|
||||
docker image prune -af;"
|
||||
environment:
|
||||
SSH_HOST:
|
||||
from_secret: SSH_HOST
|
||||
PROJECT_DIRECTORY:
|
||||
from_secret: PROJECT_DIRECTORY
|
||||
WOODPECKER_SSH_KEY:
|
||||
from_secret: WOODPECKER_SSH_KEY
|
||||
REGISTRY_IMAGE_TAG:
|
||||
from_secret: REGISTRY_IMAGE_TAG
|
||||
DOCKER_DB_VOLUME:
|
||||
from_secret: DOCKER_DB_VOLUME
|
||||
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
|
|
Loading…
Add table
Reference in a new issue