Compare commits

...
This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.

2 Commits

Author SHA1 Message Date
Matthew Sevey b34e1927da
testing 2022-05-16 15:12:08 -04:00
Matthew Sevey 9314470c67
Add health check CI action 2022-05-16 14:51:56 -04:00
4 changed files with 95 additions and 24 deletions

View File

@ -0,0 +1,90 @@
name: Health Check CI and Release
on:
push:
branches:
- master
pull_request:
paths:
- packages/health-check/**
# Nightly schedule pending full e2e testing with other repos
#schedule:
# Run daily at 1:15am
#- cron: "15 1 * * *"
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version:
# Friendly description to be shown in the UI instead of 'name'
description: "Semver type of new version (major / minor / patch)"
# Input has to be provided for the workflow to run
required: true
type: choice
options:
- patch
- minor
- major
defaults:
run:
working-directory: packages/health-check
jobs:
# Lint Dockerfile
hadolint:
uses: SkynetLabs/.github/.github/workflows/reusable_dockerfile_lint.yml@master
# Run basic yarn checks
test:
runs-on: ubuntu-latest
steps:
- name: "Run Yarn Basic Checks"
uses: SkynetLabs/.github/.github/actions/yarn-basic-checks@master
with:
node-version: 16.x
# Check if there were any changes since the last tag if this is not a push
# event
changes:
needs: [hadolint, test]
runs-on: ubuntu-latest
outputs:
updates: ${{steps.changes.outputs.any == 'true'}}
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- uses: SkynetLabs/.github/.github/actions/changes-since-last-tag@master
# Make a release if
# - there were changes and this is a scheduled job
# - This is a manually trigger job, i.e. workflow_dispatch
release:
needs: changes
runs-on: ubuntu-latest
if: ${{ (needs.changes.outputs.updates == 'true' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' }}
outputs:
new_version: ${{ steps.version.outputs.new-version }}
steps:
- uses: actions/checkout@v3
- name: Version Release
id: version
uses: SkynetLabs/.github/.github/actions/version-release@master
with:
github-token: ${{secrets.GITHUB_TOKEN}}
version-bump: ${{github.event.inputs.version}}
docker:
needs: release
name: Build and Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: SkynetLabs/.github/.github/actions/docker-publish@master
with:
docker_username: ${{ secrets.DOCKER_USERNAME}}
docker_password: ${{ secrets.DOCKER_PASSWORD}}
docker_repository: skynetlabs/health-check
semver_version: ${{ needs.release.outputs.new_version }}

View File

@ -4,7 +4,7 @@ on:
push:
branches:
- master
pull_request:
# pull_request:
jobs:
hadolint:

View File

@ -1,23 +0,0 @@
name: Lint - packages/health-check
on:
pull_request:
paths:
- packages/health-check/**
defaults:
run:
working-directory: packages/health-check
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
- run: yarn
- run: yarn prettier --check .

View File

@ -20,5 +20,9 @@
"devDependencies": {
"jest": "^28.0.3",
"prettier": "^2.6.2"
},
"scripts": {
"lint": "echo 'Warning: no lint script specified'",
"test": "echo 'Warning: no test script specified'"
}
}