diff --git a/.gitea/workflows/obs-service.yaml b/.gitea/workflows/obs-service.yaml new file mode 100644 index 0000000..71288a4 --- /dev/null +++ b/.gitea/workflows/obs-service.yaml @@ -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 }}" + + + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2dfd84f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM opensuse/tumbleweed:latest + +COPY hello.sh /hello.sh + +ENTRYPOINT ["/hello.sh"] diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..782c830 --- /dev/null +++ b/action.yml @@ -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 }} diff --git a/hello.sh b/hello.sh new file mode 100644 index 0000000..4143f1f --- /dev/null +++ b/hello.sh @@ -0,0 +1,5 @@ +#!/bin/sh -l + +echo "Hello $1" +time=$(date) +echo "time=$time" >> $GITEA_OUTPUT