Setting up CI/CD with Github Actions
This page provides a walkthrough on setting up a Github Action for deploying a PartyKit project on every commit to the main
branch.
To do so, you will first create a PartyKit token and then set up a GitHub action.
1. Create a PartyKit Access Token
On your local machine, run the following PartyKit CLI command:
This will open a new browser window to authorize you, and then generate a new long-lived session token:
2. Create Secrets in GitHub Actions
Provide the PARTYKIT_LOGIN
and PARTYKIT_TOKEN
values you generated in the previous step to GitHub actions securely following the official Using Secrets in GitHub guide.
3. Create a Github Action
Create a .github/workflows
directory in your project’s root directory. There, create a new file called deploy.yml
with the following contents:
Notice that the above GitHub action deploys the PartyKit project on every push to the main
branch.
3. Deploy 🚀
Now that the GitHub Action is set up, you can watch it run every time you push a new change to the main
branch. To see its output, click on the “Actions” tab of your repository’s top menu.
Questions? Ideas? We’d love to hear from you 🎈 Reach out to us on Discord or Twitter!