34 lines
838 B
YAML
34 lines
838 B
YAML
name: Build and deploy Docker image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: builder
|
|
env:
|
|
IMAGE: gitea.dsrptlab.com/optovia/geo/geo
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build and publish
|
|
run: |
|
|
set -euo pipefail
|
|
docker build -t "$IMAGE:latest" -t "$IMAGE:${{ gitea.sha }}" .
|
|
docker push "$IMAGE:latest"
|
|
docker push "$IMAGE:${{ gitea.sha }}"
|
|
|
|
- name: Remove local image tags
|
|
run: docker image rm -f "$IMAGE:latest" "$IMAGE:${{ gitea.sha }}"
|
|
|
|
- name: Deploy in Dokploy
|
|
env:
|
|
DOKPLOY_DEPLOY_WEBHOOK: ${{ secrets.DOKPLOY_DEPLOY_WEBHOOK }}
|
|
run: |
|
|
set -euo pipefail
|
|
test -n "$DOKPLOY_DEPLOY_WEBHOOK"
|
|
curl -fsS -X POST "$DOKPLOY_DEPLOY_WEBHOOK"
|
|
|