added github actions for the devenv operator #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Developer Environment Operator | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'devenv-operator/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'devenv-operator/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.22' | |
- name: Change directory to devenv-operator | |
run: cd devenv-operator | |
- run: pwd | |
- name: Build | |
run: make build | |
- name: Test | |
run: go test ./... -coverprofile cover.out | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push image | |
run: make docker-build docker-push | |