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.
This commit is contained in:
@@ -15,6 +15,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# Needed to push the moved tag back; checkout leaves it in the git
|
||||||
|
# config for the later push step.
|
||||||
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -26,8 +29,8 @@ jobs:
|
|||||||
- name: Move the major version tag
|
- name: Move the major version tag
|
||||||
run: |
|
run: |
|
||||||
major="${GITHUB_REF_NAME%%.*}"
|
major="${GITHUB_REF_NAME%%.*}"
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "gitea-actions"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "gitea-actions@noreply.localhost"
|
||||||
git tag -f "$major" "$GITHUB_REF_NAME"
|
git tag -f "$major" "$GITHUB_REF_NAME"
|
||||||
git push origin "refs/tags/$major" --force
|
git push origin "refs/tags/$major" --force
|
||||||
echo "Moved $major to $GITHUB_REF_NAME"
|
echo "Moved $major to $GITHUB_REF_NAME"
|
||||||
54
README.md
54
README.md
@@ -9,7 +9,7 @@ can sit behind your linters and tests, deploy the exact image you just built,
|
|||||||
and fail the run when the deployment fails.
|
and fail the run when the deployment fails.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: maxvojtkov/dokploy-deploy-action@v1
|
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DOKPLOY_HOST }}
|
host: ${{ secrets.DOKPLOY_HOST }}
|
||||||
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
||||||
@@ -22,7 +22,7 @@ and fail the run when the deployment fails.
|
|||||||
|
|
||||||
- [Why not the built-in webhook?](#why-not-the-built-in-webhook)
|
- [Why not the built-in webhook?](#why-not-the-built-in-webhook)
|
||||||
- [Quick start](#quick-start)
|
- [Quick start](#quick-start)
|
||||||
- [Gitea](#gitea)
|
- [Referencing the action](#referencing-the-action)
|
||||||
- [Choosing the service](#choosing-the-service)
|
- [Choosing the service](#choosing-the-service)
|
||||||
- [Deploying a new image](#deploying-a-new-image)
|
- [Deploying a new image](#deploying-a-new-image)
|
||||||
- [Compose stacks](#compose-stacks)
|
- [Compose stacks](#compose-stacks)
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: maxvojtkov/dokploy-deploy-action@v1
|
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DOKPLOY_HOST }}
|
host: ${{ secrets.DOKPLOY_HOST }}
|
||||||
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
||||||
@@ -91,26 +91,46 @@ Worked examples, from lint through image build to deploy:
|
|||||||
- [`examples/manual-promote.yml`](examples/manual-promote.yml) — promote or roll
|
- [`examples/manual-promote.yml`](examples/manual-promote.yml) — promote or roll
|
||||||
back an existing tag from the Actions tab.
|
back an existing tag from the Actions tab.
|
||||||
|
|
||||||
## Gitea
|
## Referencing the action
|
||||||
|
|
||||||
Nothing changes. The action is plain JavaScript with no dependencies and no
|
The action is plain JavaScript with no dependencies and no bundled `dist/`, so
|
||||||
bundled `dist/`, so Gitea's `act_runner` executes it straight from the
|
a runner executes it straight from this repository — nothing to build, nothing
|
||||||
repository, and Gitea sets the same `GITHUB_*` variables the defaults are built
|
to vendor. It also reads only `GITHUB_*` variables, which Gitea sets exactly as
|
||||||
from.
|
GitHub does, so the same step works on either.
|
||||||
|
|
||||||
How you reference it depends on your instance's `DEFAULT_ACTIONS_URL`. If it is
|
**From Gitea** — the full URL always works, whatever your instance's
|
||||||
the default (`https://github.com`), the short form works:
|
`DEFAULT_ACTIONS_URL` is set to:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: maxvojtkov/dokploy-deploy-action@v1
|
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
```
|
```
|
||||||
|
|
||||||
Otherwise give the full URL, or mirror this repository into your instance:
|
If your instance sets `DEFAULT_ACTIONS_URL = self`, the short form works too:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: https://github.com/maxvojtkov/dokploy-deploy-action@v1
|
- uses: usr_unknown/dokploy-deploy-action@v1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**From GitHub** — GitHub Actions can only resolve `uses:` against github.com;
|
||||||
|
it will not fetch an action from another host. So a GitHub workflow needs
|
||||||
|
either a mirror of this repository on github.com, or a local checkout:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: your-org/dokploy-deploy-action
|
||||||
|
ref: v1
|
||||||
|
path: .actions/dokploy-deploy
|
||||||
|
- uses: ./.actions/dokploy-deploy
|
||||||
|
with:
|
||||||
|
project: shop
|
||||||
|
service: api
|
||||||
|
```
|
||||||
|
|
||||||
|
[`examples/github-build-and-deploy.yml`](examples/github-build-and-deploy.yml)
|
||||||
|
is written in the short form, on the assumption that you have mirrored this
|
||||||
|
repository to github.com.
|
||||||
|
|
||||||
## Choosing the service
|
## Choosing the service
|
||||||
|
|
||||||
Either name the service, or give an id.
|
Either name the service, or give an id.
|
||||||
@@ -142,7 +162,7 @@ whole reason to run a deployment from CI: the image that gets deployed is the
|
|||||||
one your tests just passed against.
|
one your tests just passed against.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: maxvojtkov/dokploy-deploy-action@v1
|
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
project: shop
|
project: shop
|
||||||
service: api
|
service: api
|
||||||
@@ -172,7 +192,7 @@ Same thing, with `compose-id` or a `service` that names a stack. Images come
|
|||||||
from the Compose file, so `docker-image` does not apply:
|
from the Compose file, so `docker-image` does not apply:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: maxvojtkov/dokploy-deploy-action@v1
|
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
project: shop
|
project: shop
|
||||||
service: worker
|
service: worker
|
||||||
@@ -316,9 +336,9 @@ workflows pin.
|
|||||||
|
|
||||||
Same Dokploy API, different jobs:
|
Same Dokploy API, different jobs:
|
||||||
|
|
||||||
- [terraform-provider-dokploy](https://github.com/maxvojtkov/terraform-provider-dokploy)
|
- [terraform-provider-dokploy](https://gitea.coolify.vojtkov.dev/usr_unknown/terraform-provider-dokploy)
|
||||||
— declare projects, applications, databases and domains.
|
— declare projects, applications, databases and domains.
|
||||||
- [pulumi-dokploy](https://github.com/maxvojtkov/pulumi-dokploy) — the same, in
|
- [pulumi-dokploy](https://gitea.coolify.vojtkov.dev/usr_unknown/pulumi-dokploy) — the same, in
|
||||||
TypeScript, Python, Go or .NET.
|
TypeScript, Python, Go or .NET.
|
||||||
|
|
||||||
The usual division of labour: the provider creates the service and owns its
|
The usual division of labour: the provider creates the service and owns its
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/maxvojtkov/dokploy-deploy-action@v1
|
- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DOKPLOY_HOST }}
|
host: ${{ secrets.DOKPLOY_HOST }}
|
||||||
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
||||||
|
|||||||
@@ -66,7 +66,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: production
|
environment: production
|
||||||
steps:
|
steps:
|
||||||
- uses: maxvojtkov/dokploy-deploy-action@v1
|
# GitHub only resolves `uses:` against github.com, so this assumes the
|
||||||
|
# action is mirrored there. Pulling it from Gitea instead needs the
|
||||||
|
# checkout-then-`uses: ./` form shown in the README.
|
||||||
|
- uses: your-org/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DOKPLOY_HOST }}
|
host: ${{ secrets.DOKPLOY_HOST }}
|
||||||
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
environment: ${{ inputs.environment }}
|
environment: ${{ inputs.environment }}
|
||||||
steps:
|
steps:
|
||||||
- id: deploy
|
- id: deploy
|
||||||
uses: maxvojtkov/dokploy-deploy-action@v1
|
uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DOKPLOY_HOST }}
|
host: ${{ secrets.DOKPLOY_HOST }}
|
||||||
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
api-key: ${{ secrets.DOKPLOY_API_KEY }}
|
||||||
|
|||||||
Reference in New Issue
Block a user