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

Convert CI to Github Actions #80

Merged
merged 3 commits into from
Oct 5, 2023
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
89 changes: 0 additions & 89 deletions .drone/drone.jsonnet

This file was deleted.

104 changes: 0 additions & 104 deletions .drone/drone.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Test

on:
pull_request:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20'

- name: Build
run: go build ./...

- name: Test
run: go test ./...

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
40 changes: 40 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker

on:
pull_request:
push:
tags:
- "*"
branches:
- main

permissions:
packages: write

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Build Docker Image
run: make build

- name: Login to DockerHub
uses: docker/login-action@v1
if: github.event_name == 'push'
with:
username: USERNAME
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Docker Image
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
run: make push

- name: Push Latest Docker Image
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: make push-latest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish helm chart
name: Publish Helm Chart

on:
push:
Expand Down Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@ push: build

push-latest: build
docker push $(IMAGE)

drone:
rm -f .drone/drone.yml
drone jsonnet --stream --format --source .drone/drone.jsonnet --target .drone/temp.yml
drone lint .drone/temp.yml --trusted
drone sign --save grafana/flagger-k6-webhook .drone/temp.yml
mv .drone/temp.yml .drone/drone.yml
Loading