# Continuous Deployment of Workflows With Travis CI TD Workflows can be used with version control tools like [Git](https://git-scm.com/) and continuous integration tools such as [Travis CI](https://travis-ci.com/). In this tutorial, we’ll go through how to set up a Continuous Deployment pipeline using GitHub and Travis CI. ## Prerequisites * TD Workflows * A [GitHub](https://github.com/) account * A [Travis CI](https://travis-ci.org/) account ## GitHub Repository If you have not already done so, create a git repository on GitHub with your workflow project. For more information on how to use Git and GitHub, see the [GitHub Bootcamp](https://help.github.com/categories/bootcamp/). ## Configure Travis CI Add a Travis CI configuration file to the project. The file should be named `.travis.yml`, be in the top directory of the project, and have the following contents. Then commit and push to GitHub. ```yaml language: ruby rvm: - 2.7.2 script: - gem install td - td -e https://api.treasuredata.com -k $TD_API_KEY wf check - td -e https://api.treasuredata.com -k $TD_API_KEY wf push $WF_PROJECT branches: only: - master ``` The configuration specifies that Travis CI should deploy changes on the `master` branch only. This ensures that changes on other branches and pull requests are not deployed until they are merged to `master`. For more information on Travis CI configuration, see the [Travis CI documentation](https://docs.travis-ci.com/user/for-beginners/). ## Connect Travis CI 1. Go to [Travis-ci.com](https://travis-ci.com/) and [*Sign up with GitHub*](https://travis-ci.com/signin). 2. Accept the Authorization of Travis CI. You’ll be redirected to GitHub. 3. Select the green *Activate* button, and select the repositories you want to use with Travis CI. ### Configure TD Credentials For workflows to be pushed to Treasure Data, you must configure a TD API Key for the project. You can read more about out how to set you TD API key in Travis CI [here.](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings) To define variables within your Travis CI project: 1. From the Repository Settings, make sure you’re logged in. 2. Navigate to the repository in question. 3. Choose Settings from the cog menu. 4. Select Add new variable in the Environment Variables section. 5. Open the Travis CI dashboard again and locate the workflow repository. 6. Select the workflow project. 7. Select Repository Settings. You might need to select the down arrow and select Settings. 8. Select Environment Variables under Build Settings. 9. Type `TD_API_KEY` into the Name field and your TD API key in the Value field. 10. Select Save variables. ### Start Deploying 1. Open the Travis CI dashboard again and select the failed workflow project build. TravisCI should now successfully push your workflow to Treasure Data and executes as a workflow every time you push a change to GitHub.