Skip to content

Commit

Permalink
Add GitHub Actions Workflow to build and selftest
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Mar 9, 2022
1 parent b8b3756 commit bff3b1c
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
branches:
- master
tags:
- v**

jobs:
build:
name: Docker
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 }}
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' }}
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
17 changes: 17 additions & 0 deletions .github/workflows/selftest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Self-test

on:
workflow_dispatch:
inputs:
test:
type: boolean
default: false
description: A pointless checkbox.

jobs:
wait:
name: Wait
runs-on: ubuntu-latest
steps:
- name: Do nothing
run: sleep 30

0 comments on commit bff3b1c

Please sign in to comment.