Refactor ci workflow
This commit is contained in:
@@ -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 }}
|
||||
@@ -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
|
||||
- ®istry 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}
|
||||
Reference in New Issue
Block a user