Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overall CI enhancement #35

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

43 changes: 36 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
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 build --pull --tag quay.io/terraform-docs/gh-actions:latest .
docker push quay.io/terraform-docs/gh-actions:"${VERSION}"
docker push quay.io/terraform-docs/gh-actions:latest

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