Skip to content

Commit

Permalink
Add nightly docker build workflow (#141)
Browse files Browse the repository at this point in the history
* no --all-tags for nightly build

add nightly docker build workflow

add nightly docker build workflow

remove kubebuilder

update to workflow

* change docker build tag to repo revision
  • Loading branch information
wilsonwang371 authored Feb 14, 2022
1 parent 5ec5b60 commit de21b1f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/test-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ jobs:
wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.0.0/kubebuilder_$(go env GOOS)_$(go env GOARCH)
sudo mv kubebuilder_$(go env GOOS)_$(go env GOARCH) /usr/local/bin/kubebuilder
- name: Get revision SHA
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Get dependencies
working-directory: ${{env.working-directory}}
run: go mod download
Expand All @@ -106,8 +110,23 @@ jobs:
uses: docker-practice/actions-setup-docker@master

- name: Build Docker Image
run: make docker-image
run: IMG=kuberay/operator:${{ steps.vars.outputs.sha_short }} make docker-image
working-directory: ${{env.working-directory}}

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ github.ref == 'refs/heads/master' }}

- name: Push to DockerHub
run: |
docker push kuberay/operator:${{ steps.vars.outputs.sha_short }};
docker image tag kuberay/operator:${{ steps.vars.outputs.sha_short }} kuberay/operator:nightly;
docker push kuberay/operator:nightly
working-directory: ${{env.working-directory}}
if: ${{ github.ref == 'refs/heads/master' }}

- name: Build CLI
run: go build -o kuberay -a main.go
Expand Down

0 comments on commit de21b1f

Please sign in to comment.