-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
35 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 |
---|---|---|
@@ -1,33 +1,29 @@ | ||
name: Build Dockerhub Image | ||
|
||
on: | ||
push: | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
env: | ||
dockerUser: bencuk | ||
imageName: kubeview | ||
imageTag: latest | ||
|
||
jobs: | ||
buildJob: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Check server code with gofmt | ||
run: bash .github/workflows/gofmt-action.sh cmd/server | ||
|
||
- name: Check server code with gofmt | ||
run: bash .github/workflows/gofmt-action.sh cmd/server | ||
- name: Build the Docker image | ||
run: docker build . --file ./build/Dockerfile --build-arg buildInfo="GitHub CI build $GITHUB_RUN_ID, of $GITHUB_REF on $(date -I)" --tag ghcr.io/$GITHUB_ACTOR/$imageName:$imageTag | ||
|
||
- name: Build the Docker image | ||
run: docker build . --file ./build/Dockerfile --build-arg buildInfo="GitHub CI build $GITHUB_RUN_ID, of $GITHUB_REF on $(date -I)" --tag $dockerUser/$imageName:$imageTag | ||
|
||
- name: Login to Dockerhub | ||
if: github.repository == 'benc-uk/kubeview' && github.event_name == 'push' | ||
run: docker login -u $dockerUser -p ${{ secrets.dockerPassword }} | ||
|
||
- name: Push to Dockerhub | ||
if: github.repository == 'benc-uk/kubeview' && github.event_name == 'push' | ||
run: docker push $dockerUser/$imageName:$imageTag | ||
- name: Push to Github registry | ||
run: | | ||
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
docker push ghcr.io/$GITHUB_ACTOR/$imageName:$imageTag |
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