diff --git a/.github/workflows/runContainerAction.yml b/.github/workflows/runContainerAction.yml new file mode 100644 index 0000000..cbe4981 --- /dev/null +++ b/.github/workflows/runContainerAction.yml @@ -0,0 +1,15 @@ +name: CI build for container action + +on: + workflow_dispatch: + +jobs: + container-run: + runs-on: unbuntu-latest + steps: + - name: checkout + uses: actions/checkout@4 + - name: run my container action + uses: ./DockerAction + with: + who-to-greet: everyone diff --git a/DockerAction/DockerFile b/DockerAction/DockerFile new file mode 100644 index 0000000..1fe9ca1 --- /dev/null +++ b/DockerAction/DockerFile @@ -0,0 +1,7 @@ +FROM alpine:3.10 + +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/DockerAction/action.yml b/DockerAction/action.yml new file mode 100644 index 0000000..8184682 --- /dev/null +++ b/DockerAction/action.yml @@ -0,0 +1,13 @@ +name: 'Docker Action' +inputs: + who-to-greet: + description: who's there? + default: attendees +outputs: + time: + description: 'when it happened' +runs: + using: docker + image: DockerFile + args: + - ${{ inputs.who-to-greet }} diff --git a/DockerAction/entrypoint.sh b/DockerAction/entrypoint.sh new file mode 100644 index 0000000..646a323 --- /dev/null +++ b/DockerAction/entrypoint.sh @@ -0,0 +1,3 @@ +echo "hello $1" + +echo "time=$(date)" >> $GITHUB_OUTPUT