Skip to content

Commit

Permalink
Github actions rework (#50)
Browse files Browse the repository at this point in the history
* dummy change to test PR gha

* allow test to be run

* remove docker requirement, split out self-test

* remove last_workflow_interval
  • Loading branch information
Rabih Salamey committed Apr 26, 2022
1 parent a169123 commit c53a4c8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,41 @@ on:
- v**

jobs:
build:
name: Docker
build-docker:
name: Build docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Generate Docker meta names
uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/${{ github.repository }}
images: convictional/trigger-workflow-and-wait
tags: |
type=ref,event=tag
type=raw,enable=${{ !startsWith(github.ref, 'refs/tags/') }},value=master
- name: Build Docker image
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
- name: Test
if: ${{ false && github.event_name == 'pull_request' }}
uses: ./
with:
owner: ${{ github.repository_owner }}
repo: trigger-workflow-and-wait
ref: ${{ github.event.repository.default_branch || 'master' }}
github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
workflow_file_name: selftest.yaml
client_payload: '{"test": "true"}'
wait_interval: 11
last_workflow_interval: 5
trigger_workflow: true
wait_workflow: true
propagate_failure: true

self-test:
name: Run self-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
owner: ${{ github.repository_owner }}
repo: trigger-workflow-and-wait
ref: ${{ github.event.repository.default_branch || 'master' }}
github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
workflow_file_name: selftest.yaml
client_payload: '{"test": "true"}'
wait_interval: 11
trigger_workflow: true
wait_workflow: true
propagate_failure: true
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
description: "The repository where the workflow is contained."
required: true
github_token:
description: "The Github access token with access to the repository. Its recommended you put it under secrets."
description: "The Github access token with access to the repository. It is recommended you put this token under secrets."
required: true
github_user:
description: "The name of the github user whose access token is being used to trigger the workflow."
Expand Down

0 comments on commit c53a4c8

Please sign in to comment.