|
1 | | -# deta-deploy-action |
2 | | - Simple GitHub Action to deploy current repo to Deta |
| 1 | +# Deploy to Deta Micro |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <i>Lots of thanks to the <a href="https://github.com/Maxsior/BotCom">BotCom</a> folks for clarification and to the <b><a href="">Deta</a> folks</b> and for all the walkthroughs and hard work! 💕</i> |
| 5 | +</p> |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + <a href="https://github.com/BogDAAAMN/gh-action-deta-deploy-test/actions"><img alt="javscript-action status" src="https://github.com/BogDAAAMN/gh-action-deta-deploy-test/workflows/Deploy%20to%20Deta/badge.svg"></a> |
| 9 | +</p> |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +This is a simple GitHub Action to deploy current repo to a Deta Micro. Uses `deta deploy` command to deploy the latest changes as per [documentation](https://docs.deta.sh/docs/cli/commands/#deta-deploy). |
| 14 | + |
| 15 | +## Inputs |
| 16 | + |
| 17 | +### `deta-access-token` |
| 18 | + |
| 19 | +**Required**. The access token generated by Deta. Used for `deta clone` and `deta deploy` commands. |
| 20 | + |
| 21 | +You can generate your own access token from your [Deta account](https://web.deta.sh/home/) in order to avoid web login. Follow the Authetication documentation [here](https://docs.deta.sh/docs/cli/auth). |
| 22 | + |
| 23 | +⚠️ Be **very** sure you don't share the token or paste it in plain text! You can add it to the GitHub project's secrets as it follows: |
| 24 | + |
| 25 | +- On your project's page click on the **Settings** button; |
| 26 | +- Navigate to **Secrets** panel; |
| 27 | +- Click on **New secret**; |
| 28 | +- Name it `DETA_TOKEN` and paste the key there. |
| 29 | + |
| 30 | +Now you can use the key in your project's actions as `${{ secrets.DETA_TOKEN }}`. Read more about [GitHub Secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets). |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +### `deta-name` |
| 35 | + |
| 36 | +**Required**. The name of the existing Deta Micro you are deploying to. Used for `deta clone` command in order to retrieve the latest information about the targeted Micro. |
| 37 | + |
| 38 | +### `deta-project` |
| 39 | + |
| 40 | +The name of the Deta project your Micro is part of. Used for `deta clone` command in order to retrieve the latest information about the targeted Micro. Default `"default"`. |
| 41 | + |
| 42 | +## Example action workflow |
| 43 | + |
| 44 | +```yaml |
| 45 | +name: Deploy to Deta |
| 46 | +on: push |
| 47 | + |
| 48 | +jobs: |
| 49 | + deploy: |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v2 #Be sure you check-out the repo first. Deta CLI needs access to the files |
| 53 | + - uses: BogDAAAMN/deta-deploy-action@v1.0.0 |
| 54 | + with: |
| 55 | + deta-access-token: ${{ secrets.DETA_TOKEN }} #Deta access token https://docs.deta.sh/docs/cli/auth |
| 56 | + deta-name: 'micro-name' #Deta Micro name https://docs.deta.sh/docs/cli/commands/#deta-clone |
| 57 | + deta-project: 'project-name' #Deta project name https://docs.deta.sh/docs/cli/commands/#deta-clone |
| 58 | +``` |
0 commit comments