diff --git a/.github/workflows/release.yml b/.gitea/workflows/release.yml similarity index 70% rename from .github/workflows/release.yml rename to .gitea/workflows/release.yml index c870b1b..072913d 100644 --- a/.github/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -15,6 +15,9 @@ jobs: - uses: actions/checkout@v4 with: 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 with: @@ -26,8 +29,8 @@ jobs: - name: Move the major version tag run: | major="${GITHUB_REF_NAME%%.*}" - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" + git config user.name "gitea-actions" + git config user.email "gitea-actions@noreply.localhost" git tag -f "$major" "$GITHUB_REF_NAME" git push origin "refs/tags/$major" --force echo "Moved $major to $GITHUB_REF_NAME" diff --git a/.github/workflows/test.yml b/.gitea/workflows/test.yml similarity index 100% rename from .github/workflows/test.yml rename to .gitea/workflows/test.yml diff --git a/README.md b/README.md index aa820ef..5f37e4e 100644 --- a/README.md +++ b/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. ```yaml -- uses: maxvojtkov/dokploy-deploy-action@v1 +- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1 with: host: ${{ secrets.DOKPLOY_HOST }} 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) - [Quick start](#quick-start) -- [Gitea](#gitea) +- [Referencing the action](#referencing-the-action) - [Choosing the service](#choosing-the-service) - [Deploying a new image](#deploying-a-new-image) - [Compose stacks](#compose-stacks) @@ -67,7 +67,7 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: maxvojtkov/dokploy-deploy-action@v1 + - uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1 with: host: ${{ secrets.DOKPLOY_HOST }} 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 back an existing tag from the Actions tab. -## Gitea +## Referencing the action -Nothing changes. The action is plain JavaScript with no dependencies and no -bundled `dist/`, so Gitea's `act_runner` executes it straight from the -repository, and Gitea sets the same `GITHUB_*` variables the defaults are built -from. +The action is plain JavaScript with no dependencies and no bundled `dist/`, so +a runner executes it straight from this repository — nothing to build, nothing +to vendor. It also reads only `GITHUB_*` variables, which Gitea sets exactly as +GitHub does, so the same step works on either. -How you reference it depends on your instance's `DEFAULT_ACTIONS_URL`. If it is -the default (`https://github.com`), the short form works: +**From Gitea** — the full URL always works, whatever your instance's +`DEFAULT_ACTIONS_URL` is set to: ```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 -- 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 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. ```yaml -- uses: maxvojtkov/dokploy-deploy-action@v1 +- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1 with: project: shop 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: ```yaml -- uses: maxvojtkov/dokploy-deploy-action@v1 +- uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1 with: project: shop service: worker @@ -316,9 +336,9 @@ workflows pin. 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. -- [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. The usual division of labour: the provider creates the service and owns its diff --git a/examples/gitea-build-and-deploy.yml b/examples/gitea-build-and-deploy.yml index f1f5563..01392f5 100644 --- a/examples/gitea-build-and-deploy.yml +++ b/examples/gitea-build-and-deploy.yml @@ -60,7 +60,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: https://github.com/maxvojtkov/dokploy-deploy-action@v1 + - uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1 with: host: ${{ secrets.DOKPLOY_HOST }} api-key: ${{ secrets.DOKPLOY_API_KEY }} diff --git a/examples/github-build-and-deploy.yml b/examples/github-build-and-deploy.yml index 4a1e0d8..8db240e 100644 --- a/examples/github-build-and-deploy.yml +++ b/examples/github-build-and-deploy.yml @@ -66,7 +66,10 @@ jobs: runs-on: ubuntu-latest environment: production 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: host: ${{ secrets.DOKPLOY_HOST }} api-key: ${{ secrets.DOKPLOY_API_KEY }} diff --git a/examples/manual-promote.yml b/examples/manual-promote.yml index ba6e52b..c32b063 100644 --- a/examples/manual-promote.yml +++ b/examples/manual-promote.yml @@ -22,7 +22,7 @@ jobs: environment: ${{ inputs.environment }} steps: - id: deploy - uses: maxvojtkov/dokploy-deploy-action@v1 + uses: https://gitea.coolify.vojtkov.dev/usr_unknown/dokploy-deploy-action@v1 with: host: ${{ secrets.DOKPLOY_HOST }} api-key: ${{ secrets.DOKPLOY_API_KEY }}