Connect your GitHub Actions workflow to Humanitec
This page explains how to connect your GitHub Actions workflow to the Humanitec platform to retrieve your container images from your repositories.
Create a new workflow
If you do not have a GitHub Actions workflow set up, you will need to create one.
- Go to the GitHub repository you want to connect.
- Click the Actions tab.
- Click the Set up a workflow yourself button in the top right corner.
- Remove all of the lines after the line that says:
- uses: actions/[email protected]. The resulting file should look like this:
# This is a basic workflow to help you get started with Actions. name: CI # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: push: branches: [ master ] pull_request: branches: [ master ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/[email protected]
Note that this file is not yet committed to the repository. In the next step, you will add the necessary configurations to connect to the Humanitec platform.
Add Humanitec snippet and token to workflow
- Log in to the Humanitec platform.
- Click the profile icon in the top right.
- Select Account Settings.
- Click on your organization.
- Select the Module Sources tab.
- Click the GitHub Actions button.
From there, the platform will provide you with an access token for connecting to Humanitec’s registry and a code snippet to add to your workflow configuration in order to push the image. Instructions will appear in the modal.