Skip to content

Commit

Permalink
Merge pull request #3 from snapp-incubator/feat/ci-build-on-tag
Browse files Browse the repository at this point in the history
build on tags only
  • Loading branch information
SamMHD authored Aug 28, 2023
2 parents fcd06bf + 14c2cce commit 1ac7fa5
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 67 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/main.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Create Release

on:
push:
tags:
- "v*"

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- uses: docker/setup-qemu-action@v2
with:
platforms: amd64

- uses: docker/setup-buildx-action@v2

- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: little-core-labs/[email protected]
id: tagName
with:
tagRegex: "v(.*)"
tagRegexGroup: 1

- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository }}

- uses: docker/build-push-action@v4
with:
file: "Dockerfile"
context: .
platforms: linux/amd64
push: true
tags: ghcr.io/snapp-incubator/cerberus:${{ steps.tagName.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint and Test

on:
push:

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.19"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 5m
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: run tests using make
run: make test

0 comments on commit 1ac7fa5

Please sign in to comment.