Skip to content

Commit

Permalink
Convert CI to Github Actions (#80)
Browse files Browse the repository at this point in the history
* Convert CI to Github Actions

* Golang 1.20

* Only login on pushes
  • Loading branch information
julienduchesne authored Oct 5, 2023
1 parent 8698aff commit 5062430
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 202 deletions.
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

0 comments on commit 5062430

Please sign in to comment.