├── .github └── FUNDING.yml ├── LICENSE ├── action.yml └── readme.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: benbristow -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Ben Bristow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Dokploy Deployment' 2 | description: 'Trigger a Dokploy deployment' 3 | branding: 4 | icon: 'upload-cloud' 5 | color: 'gray-dark' 6 | inputs: 7 | dokploy_url: 8 | description: 'Dokploy base URL, e.g. https://dokploy.example.com' 9 | required: true 10 | auth_token: 11 | description: 'Dokploy authentication token' 12 | required: true 13 | application_id: 14 | description: 'Dokploy application ID' 15 | required: true 16 | runs: 17 | using: "composite" 18 | steps: 19 | - name: Trigger Dokploy deployment 20 | shell: bash 21 | env: 22 | DOKPLOY_URL: ${{ inputs.dokploy_url }} 23 | DOKPLOY_AUTH_TOKEN: ${{ inputs.auth_token }} 24 | DOKPLOY_APPLICATION_ID: ${{ inputs.application_id }} 25 | run: | 26 | response=$(curl -X 'POST' \ 27 | "$DOKPLOY_URL/api/application.deploy" \ 28 | -H 'accept: application/json' \ 29 | -H 'Content-Type: application/json' \ 30 | -H "Authorization: Bearer $DOKPLOY_AUTH_TOKEN" \ 31 | -d "{\"applicationId\": \"$DOKPLOY_APPLICATION_ID\"}" \ 32 | -w "%{http_code}" \ 33 | -o /dev/null \ 34 | -s) 35 | 36 | if [ "$response" -ne 200 ]; then 37 | echo "Deployment failed with status code: $response" 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Dokploy Deployment GitHub Action 2 | 3 | This GitHub Action triggers a deployment on Dokploy. 4 | 5 | ## Inputs 6 | 7 | ### `auth_token` 8 | 9 | **Required** The Dokploy authentication token. 10 | 11 | ### `application_id` 12 | 13 | **Required** The Dokploy application ID. 14 | 15 | ### `dokploy_url` 16 | 17 | **Required** Dokploy dashboard URL (this should have the Dokploy API accessible at /api) - no trailing backslash. 18 | 19 | e.g. `https://server.example.com` 20 | 21 | ## Usage 22 | 23 | To use this action, include it in your workflow file as follows: 24 | 25 | ```yaml 26 | name: Dokploy Deployment Workflow 27 | 28 | on: [push] 29 | 30 | jobs: 31 | deploy: 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: Checkout code 35 | uses: actions/checkout@v4 36 | 37 | - name: Dokploy Deployment 38 | uses: benbristow/dokploy-deploy-action@0.0.1 39 | with: 40 | auth_token: ${{ secrets.DOKPLOY_AUTH_TOKEN }} 41 | application_id: ${{ secrets.DOKPLOY_APPLICATION_ID }} 42 | dokploy_url: ${{ secrets.DOKPLOY_URL }} 43 | ``` 44 | 45 | ## Contributing 46 | 47 | Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests. 48 | 49 | 50 | ## License 51 | 52 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. --------------------------------------------------------------------------------