feat: Add Gitea Actions pipeline and Docker deployment config
Some checks failed
Build and Deploy / build-and-push (push) Failing after 12m54s
Some checks failed
Build and Deploy / build-and-push (push) Failing after 12m54s
This commit is contained in:
50
.gitea/workflows/build-deploy.yaml
Normal file
50
.gitea/workflows/build-deploy.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Convert repository name to lowercase
|
||||
run: echo "repo_name=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.blyzer.com.br
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
gitea.blyzer.com.br/${{ env.repo_name }}:latest
|
||||
gitea.blyzer.com.br/${{ env.repo_name }}:${{ gitea.sha }}
|
||||
# Vite requires these variables at BUILD time to embed them in the static files
|
||||
build-args: |
|
||||
VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL }}
|
||||
VITE_SUPABASE_ANON_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY }}
|
||||
GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY || '' }}
|
||||
|
||||
- name: Deploy to Portainer
|
||||
run: |
|
||||
if [ -n "${{ secrets.PORTAINER_WEBHOOK }}" ]; then
|
||||
curl -k -X POST "${{ secrets.PORTAINER_WEBHOOK }}"
|
||||
echo "Deployment triggered via Portainer Webhook."
|
||||
else
|
||||
echo "PORTAINER_WEBHOOK secret not set, skipping deployment trigger."
|
||||
fi
|
||||
Reference in New Issue
Block a user