added woodpecker, updated build to update latest
All checks were successful
Build and Push Image / build-and-push (push) Successful in 6m21s
All checks were successful
Build and Push Image / build-and-push (push) Successful in 6m21s
This commit is contained in:
46
.github/workflows/.woodpecker.yaml
vendored
Normal file
46
.github/workflows/.woodpecker.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
pipeline:
|
||||||
|
build-and-push:
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: AobaServer/Dockerfile
|
||||||
|
context: .
|
||||||
|
repo: git.kaisei.app/amatsugu/aoba
|
||||||
|
tags: latest
|
||||||
|
username:
|
||||||
|
from_secret: docker_user
|
||||||
|
password:
|
||||||
|
from_secret: docker_pass
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: appleboy/ssh
|
||||||
|
settings:
|
||||||
|
host: your-app-host.internal
|
||||||
|
username: deploy
|
||||||
|
key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
port: 22
|
||||||
|
script:
|
||||||
|
- docker pull git.kaisei.app/amatsugu/aoba:latest
|
||||||
|
|
||||||
|
# Run temporary container on docker network, no port binding
|
||||||
|
- docker run -d --rm \
|
||||||
|
--name aoba-temp \
|
||||||
|
--network aoba-net \
|
||||||
|
git.kaisei.app/amatsugu/aoba:latest
|
||||||
|
|
||||||
|
# Wait for it to become healthy
|
||||||
|
- sleep 3
|
||||||
|
- curl -f http://aoba-temp:8080 --connect-timeout 2 || (echo "Health check failed" && docker stop aoba-temp && exit 1)
|
||||||
|
|
||||||
|
# Stop old container (bound to host port)
|
||||||
|
- docker stop aoba || true
|
||||||
|
|
||||||
|
# Start new container on network and bind to host port 8080
|
||||||
|
- docker run -d --rm \
|
||||||
|
--name aoba \
|
||||||
|
--network aoba-net \
|
||||||
|
-p 9432:8080 \
|
||||||
|
git.kaisei.app/amatsugu/aoba:latest
|
||||||
|
|
||||||
|
# Stop temp container
|
||||||
|
- docker stop aoba-temp || true
|
||||||
56
.github/workflows/release.yaml
vendored
56
.github/workflows/release.yaml
vendored
@@ -1,37 +1,39 @@
|
|||||||
name: "Build and Push Image"
|
name: "Build and Push Image"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkou code
|
- name: Checkou code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Build
|
- name: Set up Docker Build
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login
|
- name: Login
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.kaisei.app
|
registry: git.kaisei.app
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Extract tag version
|
- name: Extract tag version
|
||||||
id: extract_tag
|
id: extract_tag
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
file: AobaServer/Dockerfile
|
file: AobaServer/Dockerfile
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: git.kaisei.app/amatsugu/aoba:${{ env.VERSION }}
|
tags: |
|
||||||
build-args: VERSION=${{ env.VERSION }}
|
git.kaisei.app/amatsugu/aoba:${{ env.VERSION }}
|
||||||
|
git.kaisei.app/amatsugu/aoba:latest
|
||||||
|
build-args: VERSION=${{ env.VERSION }}
|
||||||
|
|||||||
Reference in New Issue
Block a user