diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..8f7e23e --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,2 @@ +ignored: + - DL3008 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b0a2add --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Container image that runs your code +FROM debian:12.8-slim + +# compare https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/ +RUN apt-get update && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get install --no-install-recommends -y git nodejs gpg npm dnsutils \ + apt-transport-https ca-certificates curl gnupg # packages in this line required for kubectl && \ + curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ + chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ + echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list && \ + chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly && \ + apt-get update && apt-get install -y kubectl && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] + diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..25caa1f --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +# action.yml +name: "Hello World" +description: "Greet someone and record the time" +inputs: + who-to-greet: # id of input + description: "Who to greet" + required: true + default: "World" +outputs: + time: # id of output + description: "The time we greeted you" +runs: + using: "docker" + image: "Dockerfile" + args: + - ${{ inputs.who-to-greet }} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..0d7874b --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh -l + +echo "Hello $1" +time=$(date) +echo "time=$time" >>"$GITHUB_OUTPUT"