add hello-world action
as per https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action
This commit is contained in:
parent
acec852010
commit
ae138368b1
2
.hadolint.yaml
Normal file
2
.hadolint.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ignored:
|
||||||
|
- DL3008
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -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"]
|
||||||
|
|
16
action.yml
Normal file
16
action.yml
Normal file
@ -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 }}
|
5
entrypoint.sh
Executable file
5
entrypoint.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh -l
|
||||||
|
|
||||||
|
echo "Hello $1"
|
||||||
|
time=$(date)
|
||||||
|
echo "time=$time" >>"$GITHUB_OUTPUT"
|
Loading…
Reference in New Issue
Block a user