feat: use portainer hook instead of pushing image to gitea package repository
All checks were successful
Deploy / build (push) Successful in 37s
Deploy / deploy (push) Successful in 1s

This commit is contained in:
2026-05-31 00:03:49 +02:00
parent a0427ce1e9
commit 915a466310
2 changed files with 33 additions and 30 deletions

View File

@@ -1,30 +0,0 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.pihkaal.me
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t git.pihkaal.me/pihkaal/gitea-auto-urls:latest .
docker push git.pihkaal.me/pihkaal/gitea-auto-urls:latest

View File

@@ -0,0 +1,33 @@
name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build .
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Redeploy Portainer stack
run: |
curl -X POST "${{ vars.PORTAINER_URL }}/api/stacks/${{ vars.PORTAINER_STACK_ID }}/git/redeploy?endpointId=${{ vars.PORTAINER_ENDPOINT_ID }}" \
-H "X-API-Key: ${{ secrets.PORTAINER_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"pullImage": true}'