GitHub Actions Overview#
NPL Drupal sites hosted on Pantheon all use the same development workflow comprised of the following:#
- Local development using DDEV or Lando.
- Main code repository in GitHub (instead of Pantheon).
- Pantheon's repository is still there and is used for deploy purposes.
- CI with GitHub Actions.
- Gitflow for creating feature branches
- Two branches (main/master and develop) in addition to feature branches.
We use 3 GitHub Actions Workflows#
- Deploy to Pantheon Multidev (happens upon opening a pull request)
- Feature branches MUST BE formated as
feature/[branchname]
. - Branch name must not exceed 11 characters.
- Creating a pull reqeust will trigger the creation of a multidev on Pantheon based on LIVE.
- Delete Pantheon Multidev
- Merging a feature branch into develop triggers the action to delete the multidev.
- Deploy to Pantheon Dev
- Pushing to origin master triggers the deploy workflow and deploys changes to DEV.
Basic Set Up#
- Grant Pantheon site access to a ci user (this is why we see ci@atendesigngroup.com - Aten CI Bot in our .yml files).
- Add secrets and variables to GitHub.
- Add GitHub Actions files to the repo (must be pushed to live before the workflow will function).
NOTE: Aten created an eamil account specifically for CI because you have to invite that USER to join the project on Pantheon. If we eliminate this user on Pantheon, our GitHub Actions workflow will break. If we ever need to change this, we'd do this:
1. Create a user account for CI (ci.nashville.gov).
1. Add the CI user to our Pantheon account.
1. Log in to Pantheon as the CI user and create a machine token.
1. Generate a new SSH key locally and add the .pub key to Pantheon.