ci: update deploy workflow for existing runner
Some checks failed
Build and Deploy / deploy (push) Has been cancelled
Some checks failed
Build and Deploy / deploy (push) Has been cancelled
This commit is contained in:
@@ -1,44 +1,29 @@
|
||||
name: Build and Deploy to Portainer
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
# Falls Ihr Runner ein anderes Label hat (z.B. 'docker', 'linux'),
|
||||
# ändern Sie 'ubuntu-latest' entsprechend ab.
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
# Hier ist die lokale IP-Adresse der Registry hinterlegt.
|
||||
# Alternativ git.purepixel.ch (je nach Gitea/Docker Setup)
|
||||
registry: 192.168.1.183:3100
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: 192.168.1.183:3100/adminpepe/lageplan:latest
|
||||
# Caching für schnellere Builds (optional)
|
||||
cache-from: type=registry,ref=192.168.1.183:3100/adminpepe/lageplan:buildcache
|
||||
cache-to: type=registry,ref=192.168.1.183:3100/adminpepe/lageplan:buildcache,mode=max
|
||||
|
||||
- name: Trigger Portainer Webhook
|
||||
- name: Login to Registry
|
||||
run: |
|
||||
echo "Triggering Portainer to pull the latest image and update the stack..."
|
||||
curl -S -X POST "${{ secrets.PORTAINER_WEBHOOK }}"
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login 192.168.1.183:3100 -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build -t 192.168.1.183:3100/adminpepe/lageplan:latest .
|
||||
|
||||
- name: Push to Registry
|
||||
run: |
|
||||
docker push 192.168.1.183:3100/adminpepe/lageplan:latest
|
||||
|
||||
- name: Redeploy via Portainer
|
||||
if: ${{ secrets.PORTAINER_WEBHOOK != '' }}
|
||||
run: |
|
||||
curl -sf -X POST "${{ secrets.PORTAINER_WEBHOOK }}" || echo "Portainer webhook failed (optional)"
|
||||
|
||||
23
deploy/docker-compose.runner.yml
Normal file
23
deploy/docker-compose.runner.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
##############################################
|
||||
# Gitea Actions Runner — Portainer Stack
|
||||
#
|
||||
# In Portainer deployen:
|
||||
# 1. Stacks → Add Stack → "gitea-runner"
|
||||
# 2. Diese YAML einfügen
|
||||
# 3. Deploy
|
||||
##############################################
|
||||
|
||||
services:
|
||||
runner:
|
||||
image: gitea/act_runner:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
GITEA_INSTANCE_URL: https://git.purepixel.ch
|
||||
GITEA_RUNNER_REGISTRATION_TOKEN: ${RUNNER_TOKEN}
|
||||
GITEA_RUNNER_NAME: lageplan-runner
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- runner_data:/data
|
||||
|
||||
volumes:
|
||||
runner_data:
|
||||
BIN
remote.txt
Normal file
BIN
remote.txt
Normal file
Binary file not shown.
Reference in New Issue
Block a user