generated from george-lim/basic-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6b022c4
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
tags: v[0-9]+.[0-9]+.[0-9]+ | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version to deploy | ||
default: 1.0.0 | ||
|
||
env: | ||
TARGET_VERSION: ${{ github.event.inputs.version || github.ref }} | ||
|
||
jobs: | ||
release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Strip target version prefix | ||
run: echo TARGET_VERSION=${TARGET_VERSION#refs/*/v} >> $GITHUB_ENV | ||
- name: Create release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ env.TARGET_VERSION }} | ||
release_name: Release v${{ env.TARGET_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
branches: main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Run linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run linter | ||
uses: github/super-linter@v3 | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 George Lim | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Basic Template | ||
|
||
[![releases](https://img.shields.io/github/v/release/george-lim/basic-template)](https://github.com/george-lim/basic-template/releases) | ||
[![ci](https://github.com/george-lim/basic-template/workflows/CI/badge.svg)](https://github.com/george-lim/basic-template/actions) | ||
[![license](https://img.shields.io/github/license/george-lim/basic-template)](https://github.com/george-lim/basic-template/blob/main/LICENSE) | ||
|
||
## [Usage](#usage) | [Features](#features) | [Examples](#examples) | [CI/CD](#cicd) | ||
|
||
Basic Template is a template repository that provides basic CI/CD workflows. | ||
|
||
## Usage | ||
|
||
Choose `george-lim/basic-template` as the template when creating a new repository. | ||
|
||
## Features | ||
|
||
Basic Template provides a `README.md`, `LICENSE` and two workflows for GitHub Actions. | ||
|
||
## Examples | ||
|
||
There are no examples to provide for Basic Template. | ||
|
||
## CI/CD | ||
|
||
### Pipeline | ||
|
||
There are two workflows in this repository. Each workflow supports manual triggering. | ||
|
||
The `CI` workflow is automatically triggered whenever there is push activity in `main` or pull request activity towards `main`. It has one job: | ||
|
||
1. Lint the codebase with GitHub's [Super-Linter](https://github.com/github/super-linter). | ||
|
||
The `CD` workflow is automatically triggered whenever there is a tag pushed to the repository. It has one job: | ||
|
||
1. Create a GitHub release with the tag. |