37 lines
948 B
YAML
37 lines
948 B
YAML
name: Build and deploy Vault image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "vault/**"
|
|
- ".gitea/workflows/deploy-vault.yaml"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: builder
|
|
env:
|
|
IMAGE: gitea.dsrptlab.com/optovia/optovia/vault
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build and publish
|
|
run: |
|
|
set -euo pipefail
|
|
docker build -f vault/Dockerfile -t "$IMAGE:latest" -t "$IMAGE:${{ gitea.sha }}" vault
|
|
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_VAULT }}
|
|
run: |
|
|
set -euo pipefail
|
|
test -n "$DOKPLOY_DEPLOY_WEBHOOK"
|
|
curl -fsS -X POST "$DOKPLOY_DEPLOY_WEBHOOK"
|
|
|