diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml deleted file mode 100644 index 7a87b53f1..000000000 --- a/.github/workflows/custom-action.yml +++ /dev/null @@ -1,15 +0,0 @@ -on: [push] - -jobs: - my-job: - runs-on: ubuntu-latest - name: A job to say hello - steps: - - name: Hello world action step - id: hello - uses: omenking/barsoom@0.0.6 - with: - name: 'Brown' - # Use the output from the `hello` step - - name: Get the Output - run: echo "The time was ${{ steps.hello.outputs.greeting }}" \ No newline at end of file diff --git a/.github/workflows/custom_action.yml b/.github/workflows/custom_action.yml new file mode 100644 index 000000000..e82947ec7 --- /dev/null +++ b/.github/workflows/custom_action.yml @@ -0,0 +1,15 @@ +on: [push] + +jobs: + hello_world_job: + runs-on: ubuntu-latest + name: A job to say hello + steps: + - name: Hello world action step + id: hello + uses: goranrad/barsoom@0.0.5 + with: + name: 'Brown' + # sssdddhe output sds from the `hello` step + - name: Get the output time + run: echo "The time was ${{ steps.hello.outputs.time }}" diff --git a/github-actions/Readme.me b/github-actions/Readme.md similarity index 100% rename from github-actions/Readme.me rename to github-actions/Readme.md diff --git a/github-actions/templates/context.yml b/github-actions/templates/context.yml new file mode 100644 index 000000000..d0d77e061 --- /dev/null +++ b/github-actions/templates/context.yml @@ -0,0 +1,16 @@ +name: Context Example + +on: [push] + +jobs: + my-context: + runs-on: self-hosted + steps: + - name: "My Step" + run: | + echo "Hello! $MY_ACTION" + echo "Hello! $MY_ACTOR" + + env: + MY_ACTION: ${{ github.action }} + MY_ACTOR: ${{ github.actor }} \ No newline at end of file diff --git a/github-actions/templates/jobs.yml b/github-actions/templates/jobs.yml new file mode 100644 index 000000000..4e93d9e22 --- /dev/null +++ b/github-actions/templates/jobs.yml @@ -0,0 +1,25 @@ +name: "Dependen jobs Example" + +on: + push: + branches: + - main + +jobs: + job2: + runs-on: self-hosted + needs: job1 + steps: + - name: "step 2" + run: | + echo "Say hello $MY_VAL" + + job1: + runs-on: self-hosted + steps: + - name: "step 1" + run: | + echo "MY_VAL=hello" >> $GITHUB_ENV + env: + MY_VAL: hello + \ No newline at end of file diff --git a/github-actions/templates/runner-self-hosted.yml b/github-actions/templates/runner-self-hosted.yml index 23bb12e71..4df014d88 100644 --- a/github-actions/templates/runner-self-hosted.yml +++ b/github-actions/templates/runner-self-hosted.yml @@ -14,4 +14,5 @@ jobs: - name: Check out repository uses: actions/checkout@v3 - name: Run a one-line script - run: echo "Hello from a self-hosted runner!" \ No newline at end of file + run: echo "Hello from a self-hosted runner!" + - name: Run a multi-line script \ No newline at end of file diff --git a/github-actions/templates/webhook.yml b/github-actions/templates/webhook.yml index dbdf1e47d..738211a78 100644 --- a/github-actions/templates/webhook.yml +++ b/github-actions/templates/webhook.yml @@ -9,7 +9,7 @@ jobs: respond-to-dispatch: runs-on: ubuntu-latest steps: - - name Checkout repo + - name: Checkout repo uses: actions/checkout@v2 - name: Run a script - run: echo "Event of type: $GITHUB_EVENT_NAME" + run: 'echo "Event of type: $GITHUB_EVENT_NAME"' \ No newline at end of file diff --git a/github-actions/templates/workflow-comand.yml b/github-actions/templates/workflow-comand.yml new file mode 100644 index 000000000..9981e18b0 --- /dev/null +++ b/github-actions/templates/workflow-comand.yml @@ -0,0 +1,25 @@ +name: "Workflow Commands" + +on: + push: + branches: + - main + +jobs: + my-job: + runs-on: self-hosted + steps: + - name: "group logging" + run: | + echo "::group::This is a group" + echo "Hello" + echo "World" + echo "::endgroup::" + + - name: "step 1" + run: | + echo "MY_VAL=hello" >> $GITHUB_ENV + + - name: "step 2" + run: | + echo $My_VAL # This will print "hello" \ No newline at end of file