├── Dockerfile ├── entrypoint.sh ├── CHANGELOG.md ├── action.yml ├── .github └── FUNDING.yml └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3 2 | 3 | RUN apk add --no-cache curl 4 | 5 | COPY entrypoint.sh /entrypoint.sh 6 | ENTRYPOINT ["/entrypoint.sh"] 7 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -l 2 | 3 | set -xe 4 | 5 | response=$(curl -X POST --fail-with-body "https://app.hatchbox.io/webhooks/deployments/$INPUT_DEPLOY_KEY?sha=$INPUT_SHA") 6 | echo "response=$response" >> $GITHUB_OUTPUT 7 | echo "Deployment has started on Hatchbox.io" 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v2 2 | 3 | * Drop Hatchbox Classic support 4 | * Deploy using ${{ github.sha }} instead of latest branch commit 5 | * Include response in GitHub Action outputs 6 | * Raise error on failure 7 | 8 | ### v1 9 | 10 | * Trigger deployments in Hatchbox.io and Hatchbox Classic -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Hatchbox.io Deploy Action' 2 | description: 'Send deployment notifications to the Hatchbox.io API' 3 | branding: 4 | icon: 'globe' 5 | color: 'red' 6 | inputs: 7 | deploy_key: 8 | description: 'Your Hatchbox.io app Deploy Key.' 9 | required: true 10 | sha: 11 | description: 'The commit sha to be deployed.' 12 | required: false 13 | default: ${{ github.sha }} 14 | outputs: 15 | response: 16 | description: "JSON response for the Hatchbox.io deployment" 17 | 18 | runs: 19 | using: 'docker' 20 | image: 'Dockerfile' 21 | args: 22 | - ${{ inputs.deploy_key }} 23 | - ${{ inputs.sha }} 24 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [excid3] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hatchbox.io Deploy Action 2 | 3 | Trigger Hatchbox.io app deployments. 4 | 5 | For Hatchbox Classic users, see [v1](). 6 | 7 | #### Inputs 8 | 9 | Use these inputs to customise the action. 10 | 11 | Input Name | Default | Required? | Description 12 | ------------ | ------------- | ------------ | ------------- 13 | deploy_key | N/A | Y | Your Hatchbox.io app's Deploy Key. 14 | sha | ${{ github.sha }} | N | The commit sha to deploy. Default's to the sha that triggered the GitHub Action. 15 | 16 | ## Usage 17 | 18 | Set `HATCHBOX_DEPLOY_KEY` in your GitHub Secrets. You can find the Deploy Key in the URL on the App's Repository tab in Hatchbox.io. 19 | 20 | #### Example 21 | 22 | ```yaml 23 | # .github/workflows/deploy.yml 24 | on: 25 | push: 26 | branches: 27 | - main 28 | 29 | jobs: 30 | build: 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: actions/checkout@v4 34 | - uses: hatchboxio/github-hatchbox-deploy-action@v2 35 | with: 36 | deploy_key: ${{ secrets.HATCHBOX_DEPLOY_KEY }} 37 | ``` 38 | --------------------------------------------------------------------------------