Skip to content

Commit 7a95bda

Browse files
committed
testing GH actions
1 parent 85443db commit 7a95bda

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on: [push]
2+
3+
jobs:
4+
hello_world_job:
5+
runs-on: ubuntu-latest
6+
name: A job to say hello
7+
steps:
8+
- name: Hello world action step
9+
id: hello
10+
uses: ansible-cloud/aap_controller_action
11+
with:
12+
who-to-greet: 'Mona the Octocat'
13+
# Use the output from the `hello` step
14+
- name: Get the output time
15+
run: echo "The time was ${{ steps.hello.outputs.time }}"

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM redhat/ubi9
2+
COPY entrypoint.sh /entrypoint.sh
3+
RUN dnf install python3.9 -y
4+
RUN dnf install python3-pip -y
5+
RUN pip3 install pip --upgrade
6+
RUN pip3 install ansible-core
7+
RUN chmod +x /entrypoint.sh
8+
ENTRYPOINT ["/entrypoint.sh"]

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# action.yml
2+
name: 'Hello World'
3+
description: 'Greet someone and record the time'
4+
inputs:
5+
who-to-greet: # id of input
6+
description: 'Who to greet'
7+
required: true
8+
default: 'World'
9+
outputs:
10+
time: # id of output
11+
description: 'The time we greeted you'
12+
runs:
13+
using: 'docker'
14+
image: 'Dockerfile'
15+
args:
16+
- ${{ inputs.who-to-greet }}

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /usr/bin/env bash
2+
3+
echo "hello"
4+
5+
echo "Hello $1"
6+
time=$(date)
7+
echo "::set-output name=time::$time"

0 commit comments

Comments
 (0)