Files
dokploy-deploy-action/examples/gitea-build-and-deploy.yml
Max Vojtkov c4a7cabcef
Some checks failed
test / test (20) (push) Successful in 1m55s
test / test (22) (push) Successful in 1m3s
test / misconfiguration (push) Successful in 16s
release / major-tag (push) Failing after 15m44s
Host the action on Gitea
Workflows move to .gitea/workflows, which Gitea prefers over
.github/workflows when both exist.

GitHub Actions can only resolve `uses:` against github.com, so the
README now spells out both forms: the full Gitea URL, and the
checkout-then-`uses: ./` fallback for a GitHub workflow that has no
mirror of this repository.
2026-08-09 12:37:09 +03:00

76 lines
2.1 KiB
YAML

# The same pipeline on Gitea Actions, pushing to Gitea's built-in registry.
#
# The only differences from the GitHub version are the registry host and the
# token: Gitea sets the same GITHUB_* variables, and the action reads them the
# same way. Requires a runner whose label provides Docker.
name: deploy
on:
push:
branches: [main]
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: false
env:
# Your Gitea instance, which is also its container registry.
REGISTRY: gitea.example.com
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm run lint
- run: npm test
build:
needs: check
runs-on: ubuntu-latest
outputs:
image: ${{ steps.meta.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
# Automatically provided by Gitea to every workflow run.
password: ${{ secrets.GITEA_TOKEN }}
- id: meta
run: |
image="$REGISTRY/$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]'):${GITHUB_SHA::7}"
echo "image=$image" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.image }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
with:
host: ${{ secrets.DOKPLOY_HOST }}
api-key: ${{ secrets.DOKPLOY_API_KEY }}
project: shop
service: api
docker-image: ${{ needs.build.outputs.image }}
registry-url: ${{ env.REGISTRY }}
registry-username: ${{ secrets.REGISTRY_USERNAME }}
# A Gitea access token with read:package, not the ephemeral
# GITEA_TOKEN: Dokploy needs credentials that outlive this run.
registry-password: ${{ secrets.REGISTRY_TOKEN }}
timeout: 900