Skip to content

Commit

Permalink
Overall CI enhancement
Browse files Browse the repository at this point in the history
Signed-off-by: Khosrow Moossavi <[email protected]>
  • Loading branch information
khos2ow committed Mar 23, 2021
1 parent 6410def commit 43ef304
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 67 deletions.
3 changes: 0 additions & 3 deletions .github/pr-labeler.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
categories:
- title: 'Features'
label: 'feature'
- title: 'Bug Fixes'
label: 'fix'
- title: 'Maintenance'
label: 'chore'
- title: "Features"
label: "feature"
- title: "Bug Fixes"
label: "fix"
- title: "Maintenance"
label: "chore"

template: |
template: |-
## What’s Changed
$CHANGES
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Build
name: ci

on:
- pull_request
pull_request:

jobs:
build:
name: Build example docs
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
Expand Down Expand Up @@ -95,3 +94,20 @@ jobs:
output-file: README.md
indention: 3
fail-on-diff: true

format:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Terraform format
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_working_dir: examples
tf_actions_version: '0.12.17'
tf_actions_subcommand: 'fmt'
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: publish

on:
push:
branches:
- main

env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to Docker
uses: docker/login-action@v1
if: env.REGISTRY_USERNAME != ''
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
if: env.REGISTRY_USERNAME != ''
run: |
docker build --pull --tag quay.io/terraform-docs/gh-actions:edge .
docker push quay.io/terraform-docs/gh-actions:edge
release-draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
32 changes: 0 additions & 32 deletions .github/workflows/pull_request.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/release-draft.yml

This file was deleted.

41 changes: 34 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
name: Release Tasks
name: release

on:
release:
types: [published]

env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}

jobs:
tag:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to Docker
uses: docker/login-action@v1
if: env.REGISTRY_USERNAME != ''
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build Docker image
if: env.REGISTRY_USERNAME != ''
run: |
VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/v//')
docker build --pull --tag quay.io/terraform-docs/gh-actions:"${VERSION}" .
docker push quay.io/terraform-docs/gh-actions:"${VERSION}"
update-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- run: |
VERSION=`echo ${{ github.event.release.tag_name }} | cut -d. -f1`
git tag -f "${VERSION}"
git push -f --tags
- run: |
VERSION=$(echo ${{ github.event.release.tag_name }} | cut -d. -f1)
git tag -f "${VERSION}"
git push -f --tags
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate
name: validate

on:
push:
Expand All @@ -8,7 +8,6 @@ on:

jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
Expand All @@ -21,7 +20,6 @@ jobs:
scandir: "./src"

readme:
name: README content
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
Expand Down

0 comments on commit 43ef304

Please sign in to comment.