Skip to content

Commit

Permalink
Migrate to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgarr committed Dec 7, 2023
1 parent c68449d commit cf52f80
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 41 deletions.
40 changes: 0 additions & 40 deletions .drone.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: push
on: push
permissions:
contents: read
id-token: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.15"
- run: go test -v -cover $(go list ./... | grep -v /vendor)
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.15"
- run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.SHA=${{ github.sha }}" -o bin/vaultcreds cmd/*.go
- uses: actions/upload-artifact@v3
with:
name: bin
path: bin/
docker-build-push:
if: github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/v')
needs: [test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: bin
path: bin/
- id: meta
uses: docker/metadata-action@v4
with:
images: quay.io/uswitch/vault-creds
tags: |
type=semver,pattern={{version}}
type=sha,prefix=,format=long,
- uses: docker/build-push-action@v4
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,7 +6,7 @@ FROM scratch

ADD bin/vaultcreds /vaultcreds

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

ENTRYPOINT ["/vaultcreds"]
CMD []

0 comments on commit cf52f80

Please sign in to comment.