-
Notifications
You must be signed in to change notification settings - Fork 45
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
3 changed files
with
55 additions
and
1 deletion.
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,38 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- uses: olegtarasov/get-tag@v1 | ||
id: tagName | ||
|
||
- name: Build image | ||
env: | ||
TAGNAME: ${{ steps.tagName.outputs.tag }} | ||
run: docker build --pull -t kooldev/kool:$TAGNAME . | ||
|
||
- name: Test image | ||
env: | ||
TAGNAME: ${{ steps.tagName.outputs.tag }} | ||
run: docker run kooldev/kool:$TAGNAME kool --version | ||
|
||
- name: Push to hub | ||
env: | ||
TAGNAME: ${{ steps.tagName.outputs.tag }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
docker tag kooldev/kool:$TAGNAME kooldev/kool:1.0 | ||
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin | ||
docker push kooldev/kool:$TAGNAME | ||
docker push kooldev/kool:1.0 |
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,2 +1,2 @@ | ||
.vscode/ | ||
/fwd | ||
/kool |
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,16 @@ | ||
FROM docker/compose:alpine-1.26.2 AS docker-compose | ||
FROM golang:alpine3.12 AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
RUN go build -o kool | ||
|
||
FROM alpine:3.12 | ||
|
||
COPY --from=docker-compose /usr/local/bin/docker /usr/local/bin/docker | ||
COPY --from=docker-compose /usr/local/bin/docker-compose /usr/local/bin/docker-compose | ||
COPY --from=build /app/kool /usr/local/bin/kool | ||
|
||
CMD [ "kool" ] |