fix: match fasto pipeline logic, url and secrets
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 1m17s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 1m17s
This commit is contained in:
@@ -5,10 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: gitea.local # Update this to your real Gitea domain
|
|
||||||
IMAGE_NAME: ${{ gitea.repository }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -16,10 +12,13 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Convert repository name to lowercase
|
||||||
|
run: echo "repo_name=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: gitea.blyzer.com.br
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
@@ -28,20 +27,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:latest
|
tags: gitea.blyzer.com.br/${{ env.repo_name }}-backend:latest
|
||||||
|
|
||||||
- name: Build and push frontend image
|
- name: Build and push frontend image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:latest
|
tags: gitea.blyzer.com.br/${{ env.repo_name }}-frontend:latest
|
||||||
|
|
||||||
- name: Trigger Portainer Webhook (Deploy)
|
- name: Deploy to Portainer
|
||||||
run: |
|
run: |
|
||||||
if [ -n "${{ secrets.PORTAINER_WEBHOOK_URL }}" ]; then
|
if [ -n "${{ secrets.PORTAINER_WEBHOOK }}" ]; then
|
||||||
echo "Triggering Portainer Webhook..."
|
curl -k -X POST "${{ secrets.PORTAINER_WEBHOOK }}"
|
||||||
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
|
||||||
else
|
else
|
||||||
echo "No webhook URL found. Skipping auto-deploy. (You can deploy manually in Portainer)"
|
echo "PORTAINER_WEBHOOK secret not set, skipping deployment trigger."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user