Simple Github Actions for Treasure Workflow
If the code of Treasure Workflow (Digdag) is managed on Github and can be pushed to Treasure Workflow using CI at the timing of being pushed to Master, the code can be centrally managed on Github and the prospect will be better. By using Github Actions, you can easily deploy to Treasure Wokflow, so I created a simple Github Actions and published them on Github Marketplace.
When the repository of Treasure Workflow managed on Github is pushed as Master, it is automatically deployed to Treasure Workflow as one project. Also, since td wf check (digdag check) is executed before pushing, Github Actions will fail if there is any syntax error.
Usage
- Create a repository for code management and deploy Workflow
Example Repo: https://github.com/toru-takahashi/tdw-actions-sample
2. Select “Setup this workflow” from Actions
3. Edit YAML on Github Actions
name: Treasure Workflow Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Treasure Workflow
uses: toru-takahashi/treasure-workflow-actions@v0.0.2
with:
# Treasure Workflow API Endpoint
td_wf_endpoint: https://api-workflow.treasuredata.com
# Treasure Data Master API
td_master_apikey: ${{ secrets.td_master_apikey }}
# Treasure Workflow Project Name
td_wf_project_name: workflow
Github Actions will be activated automatically when you push the above. However, since Secrets used in the above code is not registered, I think that an error will occur if this is not done.
4. Register td_master_apikey in Secrets
Add td_master_apikey in Settings > Secrets from Github UI.
Now, if you re-execute the task that failed earlier, it will be executed normally, and you can refer to the Workflow project from the Treasure Data Workflow UI.
Happy TreasureWorkflow&Github Actions Life!