Update .yml files

This commit is contained in:
Keannu Christian Bernasol 2025-03-27 03:35:06 +08:00
parent 29ba67dc7a
commit aa221e3382
2 changed files with 25 additions and 23 deletions

View file

@ -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

View file

@ -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