test
All checks were successful
/ debug (push) Successful in 38s

This commit is contained in:
Jonas 2024-12-15 12:16:07 +01:00
parent 6cb1aa7419
commit 120d4f2a9e
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
4 changed files with 39 additions and 4 deletions

View file

@ -5,8 +5,10 @@ jobs:
name: debug name: debug
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: build - name: hello world action step
run: | uses: ./actions/hello
apt-get install -y hugo with:
hugo who-to-greet: 'lubi'
- name: Get the output time
run: echo "The time was ${{ steps.hello.outputs.time }}"

9
actions/hello/Dockerfile Normal file
View file

@ -0,0 +1,9 @@
# Container image that runs your code
FROM alpine:edge
# 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"]

17
actions/hello/action.yml Normal file
View file

@ -0,0 +1,17 @@
# 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 }}

7
actions/hello/entrypoint.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh -l
echo "Hello $1"
time=$(date)
echo "time=$time" >> $GITHUB_OUTPUT
exit 0