Add docker_action.yaml
This commit is contained in:
5
.gitea/actions/docker-action/Dockerfile
Executable file
5
.gitea/actions/docker-action/Dockerfile
Executable file
@@ -0,0 +1,5 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
COPY entrypoint.sh entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
15
.gitea/actions/docker-action/action.yaml
Executable file
15
.gitea/actions/docker-action/action.yaml
Executable file
@@ -0,0 +1,15 @@
|
||||
name: 'Simple param action' # Name of action
|
||||
description: 'Prints the argument and stores it in the file'
|
||||
inputs:
|
||||
name:
|
||||
description: 'First argument value'
|
||||
required: true
|
||||
default: 'Mike'
|
||||
outputs:
|
||||
processed-name: # processed-name is also defined in entrypoint.sh
|
||||
description: 'Processed name'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.name }}
|
||||
15
.gitea/actions/docker-action/entrypoint.sh
Executable file
15
.gitea/actions/docker-action/entrypoint.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh -l
|
||||
|
||||
# get the input parameter
|
||||
echo "Arg received $1"
|
||||
|
||||
# list the working directory
|
||||
echo "Workdir:"
|
||||
ls -la
|
||||
|
||||
# get name and store it to name.txt
|
||||
name=$1
|
||||
echo "$name" > name.txt
|
||||
|
||||
# output processed-name to GITHUB_OUTPUT
|
||||
echo "processed-name=$name" >> $GITHUB_OUTPUT
|
||||
Reference in New Issue
Block a user