parent
6cb1aa7419
commit
120d4f2a9e
4 changed files with 39 additions and 4 deletions
|
@ -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
9
actions/hello/Dockerfile
Normal 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
17
actions/hello/action.yml
Normal 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
7
actions/hello/entrypoint.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh -l
|
||||||
|
|
||||||
|
echo "Hello $1"
|
||||||
|
time=$(date)
|
||||||
|
echo "time=$time" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in a new issue