Skip to content

Commit

Permalink
Merge pull request #34 from uswitch/gha_migration
Browse files Browse the repository at this point in the history
Migrating Hermod to use GitHub Actions
  • Loading branch information
MatteoMori8 authored Jul 8, 2024
2 parents ea8b04d + 7e09db8 commit b60516b
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 63 deletions.
62 changes: 0 additions & 62 deletions .drone.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: push

on: push

permissions:
contents: read
id-token: write

jobs:
test:
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.18"
- run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -v -cover $(go list ./...)

build:
needs: test
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.18"
- run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/hermod-linux-amd64 .
- uses: actions/upload-artifact@v4
with:
name: bin
path: bin/

docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: bin
path: bin/
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- id: meta
uses: docker/metadata-action@v5
with:
images: quay.io/uswitch/hermod
tags: |
type=semver,pattern={{raw}}
type=sha,prefix=,format=long
- uses: docker/build-push-action@v6
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ FROM scratch

COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ADD bin/hermod-linux-amd64 hermod
ADD --chmod=755 bin/hermod-linux-amd64 hermod

ENTRYPOINT ["/hermod"]

0 comments on commit b60516b

Please sign in to comment.