https://github.com/toeverything/deploy-to-nomad
https://github.com/toeverything/deploy-to-nomad
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/toeverything/deploy-to-nomad
- Owner: toeverything
- License: mit
- Created: 2022-12-05T17:34:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-04T00:06:41.000Z (over 3 years ago)
- Last Synced: 2025-02-23T16:50:14.297Z (over 1 year ago)
- Language: TypeScript
- Size: 455 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Deploy to nomad
This action will deploy docker image to nomad.
## Usage
You can now use the action like following code.
```yaml
uses: toeverything/deploy-to-nomad@main
env:
nomad-acl: ${{secrets.NOMAD_ACL_TOKEN}}
cf-access-client-id: ${{secrets.CF_ACCESS_CLIENT_ID}}
cf-access-client-secret: ${{secrets.CF_ACCESS_CLIENT_SECRET}}
with:
nomad-domain: 'nomad-dev.affine.systems'
job-id: 'Your job id & name'
image-url: 'ghcr.io/toeverything/blocksuite-icons-preview:nightly-latest'
static-port: 10022
container-port: 3000
```
## Code in Main
> First, you'll need to have a reasonably modern version of `node` handy. This won't work with versions older than 9, for instance.
Install the dependencies
```bash
$ npm install
```
Build the typescript and package it for distribution
```bash
$ npm run build && npm run package
```
Run the tests :heavy_check_mark:
```bash
$ npm test
PASS ./index.test.js
✓ throws invalid number (3ms)
✓ wait 500 ms (504ms)
✓ test runs (95ms)
...
```
## Change action.yml
The action.yml defines the inputs and output for your action.
Update the action.yml with your name, description, inputs and outputs for your action.
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
## Publish to a distribution branch
Actions are run from GitHub repos so we will checkin the packed dist folder.
Then run [ncc](https://github.com/zeit/ncc) and push the results:
```bash
$ npm run package
$ git add dist
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1
```
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
Your action is now published! :rocket:
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)