add: Gitea Actions workflow for Docker Build and Deploy
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
38
.gitea/workflows/deploy.yml
Normal file
38
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Build and Deploy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push Docker Image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/blyzer/growup-crm:latest
|
||||||
|
ghcr.io/blyzer/growup-crm:${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Deploy to Portainer
|
||||||
|
run: |
|
||||||
|
# Requires PORTAINER_WEBHOOK secret (e.g., https://portainer.domain.com/api/stacks/webhooks/...)
|
||||||
|
if [ -n "${{ secrets.PORTAINER_WEBHOOK }}" ]; then
|
||||||
|
echo "Triggering Portainer Webhook..."
|
||||||
|
curl -X POST "${{ secrets.PORTAINER_WEBHOOK }}"
|
||||||
|
else
|
||||||
|
echo "PORTAINER_WEBHOOK not set. Skipping deployment trigger."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user