Merge pull request #1 from CUBETIQ/master
Add GitHub Workflows and Update
This commit is contained in:
commit
edfb7edf36
15
.github/workflows/main.yml
vendored
Normal file
15
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Starter Docker Test
|
||||||
|
uses: cubetiq/starter-docker-actions@v1
|
||||||
|
with:
|
||||||
|
run: docker version
|
@ -2,6 +2,8 @@ FROM docker:latest
|
|||||||
|
|
||||||
RUN apk add bash
|
RUN apk add bash
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
34
README.md
34
README.md
@ -1,6 +1,38 @@
|
|||||||
# Starter Docker - GitHub Actions
|
# Starter Docker - GitHub Actions
|
||||||
- Run actions with docker
|
|
||||||
|
- Run actions with docker (latest version)
|
||||||
- Quick and easy to use
|
- Quick and easy to use
|
||||||
|
- Support custom registry
|
||||||
|
- Support custom shell and commands
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Starter Docker
|
||||||
|
uses: CUBETIQ/starter-docker-actions@v1
|
||||||
|
```
|
||||||
|
|
||||||
|
# Example Action
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Starter Docker Test
|
||||||
|
uses: cubetiq/starter-docker-actions@v1
|
||||||
|
with:
|
||||||
|
shell: sh
|
||||||
|
run: docker version
|
||||||
|
```
|
||||||
|
|
||||||
# Contributors
|
# Contributors
|
||||||
|
|
||||||
- Sambo Chea <sombochea@cubetiqs.com>
|
- Sambo Chea <sombochea@cubetiqs.com>
|
@ -1,7 +1,5 @@
|
|||||||
name: 'Starter Docker'
|
name: 'Starter Docker'
|
||||||
description: 'Starter Docker GitHub Action for CUBETIQ and docker environment.'
|
description: 'Starter Docker GitHub Action for CUBETIQ and docker environment.'
|
||||||
color: 'yellow'
|
|
||||||
icon: 'box'
|
|
||||||
inputs:
|
inputs:
|
||||||
image:
|
image:
|
||||||
description: 'Docker image name'
|
description: 'Docker image name'
|
||||||
@ -32,3 +30,6 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
branding:
|
||||||
|
color: 'yellow'
|
||||||
|
icon: 'box'
|
@ -10,4 +10,16 @@ if [ ! -z $INPUT_DOCKER_NETWORK ];
|
|||||||
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
|
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z $INPUT_SHELL ];
|
||||||
|
then INPUT_SHELL=sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z $INPUT_IMAGE ];
|
||||||
|
then INPUT_IMAGE=docker
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z $semicolon_delimited_script ];
|
||||||
|
then semicolon_delimited_script="echo $(whoami)"
|
||||||
|
fi
|
||||||
|
|
||||||
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`"
|
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`"
|
Loading…
Reference in New Issue
Block a user