Adding dockerfile and obs-service yaml

Signed-off-by: Alex Lau (AvengerMoJo) <alau@suse.com>
This commit is contained in:
Alex Lau 2023-09-20 23:43:03 +08:00
parent ec316338ae
commit 82574f4a6b
No known key found for this signature in database
GPG Key ID: 3F28752074CC2261
4 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,29 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: opensuse/tumbleweed-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by opensuse!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- name : Hello world action step
id : hello
users: action/hello-docker-action@v2
with:
who-to-greety: 'AvengerMoJo'
- name: Get the output time
run: echo "The time was ${{ steps.hello.outputs.time }}"

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM opensuse/tumbleweed:latest
COPY hello.sh /hello.sh
ENTRYPOINT ["/hello.sh"]

16
action.yml Normal file
View 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
hello.sh Normal file
View File

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