-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow that builds and push images (#234)
* add workflow that builds and push images * extend for test * fix Makefile * add build based on version.txt * another test before taking off draft * fix default tag * add echo * finish; re-add tests * limit workflow to master branch
- Loading branch information
1 parent
b25da78
commit 57aa389
Showing
5 changed files
with
75 additions
and
19 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: Build docker images | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
workflow_dispatch: | ||
inputs: | ||
docker-tag: | ||
description: 'Docker tag for push' | ||
default: 'latest' | ||
required: false | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16.4' | ||
- name: test-operator | ||
run: make -C operator test | ||
- name: test-scheduler | ||
run: make -C scheduler test | ||
|
||
docker: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Git Commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Set default docker tag for builds from master | ||
id: docker-tag | ||
run: | | ||
USER_INPUT="${{ github.event.inputs.name }}" | ||
echo ::set-output name=value::${USER_INPUT:-"latest"} | ||
- name: Echo the tags that will be used to push images | ||
run: echo "Will push images with tag ${{ steps.docker-tag.outputs.value }}" | ||
|
||
- name: Push Docker Image for Operator | ||
working-directory: ./operator | ||
run: CUSTOM_IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make docker-build docker-push | ||
|
||
- name: Push Docker Images for Scheduler | ||
working-directory: ./scheduler | ||
run: CUSTOM_IMAGE_TAG=${{ steps.docker-tag.outputs.value }} make docker-build-all docker-push-all |
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
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
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
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