-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maartje Eyskens <[email protected]>
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
pull_request: #dev only, remove me!!! | ||
|
||
|
||
jobs: | ||
build-test: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- name: Create Kind Cluster | ||
uses: helm/kind-action@v1 | ||
with: | ||
cluster_name: kind | ||
- name: Install ko | ||
uses: ko-build/[email protected] | ||
env: | ||
KO_DOCKER_REPO: kind.local | ||
- name: Install dependencies | ||
run: | | ||
go mod download | ||
- name: Run a ko build | ||
run: just build | ||
env: | ||
KO_DOCKER_REPO: ghcr.io/cofide/cofidectl-debug-container | ||
- name: Tag the image with the release tag | ||
if: github.event_name == 'release' | ||
run: | | ||
docker tag ghcr.io/cofide/cofidectl-debug-container:latest ghcr.io/cofide/cofidectl-debug-container:${GITHUB_REF#refs/tags/} | ||
- name: Tag the image with the commit hash | ||
if: github.event_name != 'release' | ||
run: | | ||
docker tag ghcr.io/cofide/cofidectl-debug-container:latest ghcr.io/cofide/cofidectl-debug-container:${GITHUB_SHA} | ||
- name: Login to GitHub Container Registry | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u cofide --password-stdin | ||
- name: Push the release tag | ||
if: github.event_name == 'release' | ||
run: | | ||
docker push ghcr.io/cofide/cofidectl-debug-container:${GITHUB_REF#refs/tags/} | ||
- name: Push the commit hash | ||
if: github.event_name == 'release' | ||
run: | | ||
docker push ghcr.io/cofide/cofidectl-debug-container:${GITHUB_SHA} |