Files
davidaragon-portfolio/.gitea/workflows/ci-cd.yaml
T
wh-leader 8176b0b09b
CI/CD Pipeline / Build & Deploy (push) Failing after 28s
fix(ci): use plain docker + git instead of GitHub actions
2026-05-11 13:09:48 +02:00

45 lines
1.6 KiB
YAML

name: CI/CD Pipeline
on:
push:
branches: [main]
jobs:
deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: Clone repo
run: |
git clone --depth=1 --branch=main https://gitlab.impresion3d.pro/root/davidaragon-portfolio.git repo
cd repo && ls -la
- name: Build image with docker
run: |
cd repo
docker build -t gitlab.impresion3d.pro/root/davidaragon-portfolio:latest .
- name: Login to registry
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login gitlab.impresion3d.pro -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push image
run: |
docker push gitlab.impresion3d.pro/root/davidaragon-portfolio:latest
- name: Stop Portainer stack
run: |
curl -X POST "${{ secrets.PORTAINER_URL }}/api/stacks/${{ secrets.PORTAINER_STACK_ID }}/stop?endpointId=${{ secrets.PORTAINER_ENDPOINT_ID }}" \
-H "X-API-Key: ${{ secrets.PORTAINER_TOKEN }}"
sleep 5
- name: Pull fresh image
run: |
curl -X POST "${{ secrets.PORTAINER_URL }}/api/endpoints/${{ secrets.PORTAINER_ENDPOINT_ID }}/docker/images/create?fromImage=gitlab.impresion3d.pro%2Froot%2Fdavidaragon-portfolio&tag=latest" \
-H "X-API-Key: ${{ secrets.PORTAINER_TOKEN }}"
- name: Start Portainer stack
run: |
curl -X POST "${{ secrets.PORTAINER_URL }}/api/stacks/${{ secrets.PORTAINER_STACK_ID }}/start?endpointId=${{ secrets.PORTAINER_ENDPOINT_ID }}" \
-H "X-API-Key: ${{ secrets.PORTAINER_TOKEN }}"