Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Automatically push docker containers (#99)
Browse files Browse the repository at this point in the history
* automatically push docker containers

* fix branchane,
  • Loading branch information
davidsiaw authored Jun 7, 2024
1 parent 590dfd9 commit 1822caa
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/docker-branch-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: docker-branch-build
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: extract_branch
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: degicadev
password: ${{ secrets.DOCKERHUB_PAT }}
- name: setup
run: |-
docker build . -t degicadev/kaiser:branch-${{ steps.extract_branch.outputs.branch }}
docker push degicadev/kaiser:branch-${{ steps.extract_branch.outputs.branch }}
'on':
push:
branches:
- '*'
24 changes: 24 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: docker
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: degicadev
password: ${{ secrets.DOCKERHUB_PAT }}
- name: setup
run: |-
docker build . -t degicadev/kaiser:latest
docker push degicadev/kaiser:latest
docker build . -t degicadev/kaiser:`bin/version`
docker push degicadev/kaiser:`bin/version`
'on':
push:
branches:
- 'master'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ docker build -t degica/kaiser .
And then add the following line to your `.bashrc` or `.bash_profile`

```
alias kaiser='docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.kaiser:/root/.kaiser -v `pwd`:`pwd` -e CONTEXT_DIR="`pwd`" degica/kaiser'
alias kaiser='docker run --pull=always --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.kaiser:/root/.kaiser -v `pwd`:`pwd` -e CONTEXT_DIR="`pwd`" degicadev/kaiser'
```

Or if you use fish

```
function kaiser
docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.kaiser:/root/.kaiser -v (pwd):(pwd) -e CONTEXT_DIR=(pwd) degica/kaiser $argv
docker run --pull=always --rm -ti -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.kaiser:/root/.kaiser -v (pwd):(pwd) -e CONTEXT_DIR=(pwd) degicadev/kaiser $argv
end
```

Expand Down

0 comments on commit 1822caa

Please sign in to comment.