-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
47c3db0
commit 9f187c7
Showing
3 changed files
with
63 additions
and
0 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,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker build branch | ||
run: make docker | ||
if: ${{ github.ref_type == 'branch' }} | ||
|
||
- name: Docker build main | ||
run: make docker ARGS="-t latest" | ||
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }} | ||
|
||
- name: Docker build tag | ||
run: make docker ARGS="-t ${{github.ref_name}}" | ||
if: ${{ github.ref_type == 'tag' }} |
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,26 @@ | ||
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
CONTAINER_CODE_DIR=/opt/code | ||
|
||
#TODO - registry var needs to move elsewhere. Builder? | ||
DOCKER_REGISTRY=index.docker.io/flounder5 | ||
DOCKER_REPO=builder-bash | ||
DOCKER_BUILD_CMD=dockerBuildStandard -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS} | ||
#TODO | ||
DOCKER_BUILDER_IMAGE=flounder5/builder-docker:v0.0.4 | ||
DOCKER_BUILDER_PULL_CMD=docker pull ${DOCKER_BUILDER_IMAGE} | ||
DOCKER_BUILDER_RUN_CMD=${DOCKER_BUILDER_PULL_CMD} && \ | ||
docker run \ | ||
--rm \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v ${HOME}/.docker:/tmp/.docker:ro \ | ||
-v ${ROOT_DIR}:${CONTAINER_CODE_DIR} \ | ||
${DOCKER_BUILDER_IMAGE} | ||
|
||
.PHONY: docker | ||
|
||
docker: | ||
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_CMD} | ||
|
||
#Everything right of the pipe is order-only prerequisites. | ||
all: | docker |
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,8 @@ | ||
#TODO | ||
FROM flounder5/runner-bash:3bc95641187ab116fad9f5695f827b48c9d0ca23 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
shellcheck && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* |