Refactor ci workflow
All checks were successful
ci / Image build (push) Successful in 1m53s
ci / Deployment (push) Successful in 5s

This commit is contained in:
Joris Bertomeu
2024-10-01 11:38:44 +02:00
parent 06797af615
commit f5d47034b3
2 changed files with 1 additions and 50 deletions

View File

@@ -57,4 +57,4 @@ jobs:
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker stop ${{ env.CONTAINER_NAME }} || true
docker rm ${{ env.CONTAINER_NAME }} || true
docker run -d --name ${{ env.CONTAINER_NAME }} -p 6080:80 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
docker run -d --name ${{ env.CONTAINER_NAME }} -p ${{ vars.CONTAINER_EXTERNAL_PORT }}:${{ vars.CONTAINER_INTERNAL_PORT }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

View File

@@ -1,49 +0,0 @@
# Build and publish Docker images for multiple architectures.
#
# Pushing an image to codeberg's container registry
# The package owner will be the repo owner.
#
# This config also shows usage of yaml aliases and
# was taken from https://codeberg.org/6543/docker-images/src/commit/37e29c227717c1c07d2776cddcf14725bf952875/.woodpecker/hello.yml
when:
- event: [push, manual]
branch: main
variables:
- &file Dockerfile
- &registry http://192.168.1.230:5000
- &repo 192.168.1.230:5000/bertomlab/crawlflix/front
steps:
publish:
image: woodpeckerci/plugin-docker-buildx
settings:
dockerfile: *file
registry: *registry
repo: *repo
insecure: true
platforms: linux/amd64
buildkit_config: |
[registry."192.168.1.230:5000"]
http = true
tags:
- latest
- ${CI_COMMIT_SHA}
username:
from_secret: docker_registry_username
password:
from_secret: docker_registry_password
deploy:
image: appleboy/drone-ssh
settings:
host: 192.168.1.222
username:
from_secret: ssh_deploy_username
password:
from_secret: ssh_deploy_password
port: 22
script:
- docker pull ${REPO}:${CI_COMMIT_SHA}
- docker rm -f crawlflix-front || true
- docker run -d --name crawlflix-front --restart always -p 2480:80 ${REPO}:${CI_COMMIT_SHA}