Skip to content

Commit

Permalink
Add Github actions pipelines for verify & release procedures (#1)
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.dev>
  • Loading branch information
teran authored Jul 6, 2024
1 parent c23f838 commit 2ebc776
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...
3. ...
4. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Configuration file snippet**

```
// config.yaml or json
```

**Additional context**
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE REQUEST] "
labels: enhancement
assignees: ''

---

**What is your use case?**
What real problem are you trying to solve?

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
107 changes: 107 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
name: release

on:
push:
tags:
- 'v*'

jobs:
hadolint-access:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile.access

hadolint-manage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile.manage

markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: articulate/actions-markdownlint@v1

unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Test with the Go CLI
run: go test ./...
- name: Build
run: go build -v ./...

build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs:
- hadolint
- markdownlint
- unittests
steps:
- name: Define build timestamp
id: timestamp
run: echo "::set-output name=now::$(date -u +'%Y%m%d%H%M%S')"
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Build & Publish release release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push access container image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.access
platforms: amd64
push: true
tags: |
ghcr.io/${{ github.repository }}/access:latest
ghcr.io/${{ github.repository }}/access:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/access:${{ github.ref_name }}-${{ steps.timestamp.outputs.now }}
outputs: type=image,name=ghcr.io/${{ github.repository }}/access,annotation-index.org.opencontainers.image.description=${{ github.repository }}
- name: Build and push manage container image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.manage
platforms: amd64
push: true
tags: |
ghcr.io/${{ github.repository }}/manage:latest
ghcr.io/${{ github.repository }}/manage:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/manage:${{ github.ref_name }}-${{ steps.timestamp.outputs.now }}
outputs: type=image,name=ghcr.io/${{ github.repository }}/manage,annotation-index.org.opencontainers.image.description=${{ github.repository }}
68 changes: 68 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: verify

on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
hadolint-access:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile.access

hadolint-manage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile.manage

markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: articulate/actions-markdownlint@v1

unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Test with the Go CLI
run: go test ./...

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Build project against .goreleaser.yaml
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2ebc776

Please sign in to comment.