Skip to content

Commit

Permalink
migrate to gha
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgarr committed Jul 8, 2024
1 parent ead4556 commit dbf8184
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/rvu/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service.rvu.co.uk/brand: airship
23 changes: 0 additions & 23 deletions .github/workflows/CD.yaml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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@v5
with:
go-version: "1.15"
- run: go test -v -cover $(shell go list ./... | grep -v /vendor)
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.15"
- run: CGO_ENABLED=0 GOOS=linux go build -o bin/aws-sigv4-proxy
- uses: actions/upload-artifact@v4
with:
name: bin
path: bin/
docker-latest:
needs:
- test
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_ECR_IAM_ROLE }}
- uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: "true"
- uses: actions/download-artifact@v4
with:
name: bin
path: bin/
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.IMAGE_NAME_DEFAULT }}
tags: |
type=semver,pattern={{raw}}
type=sha,prefix=,format=long,
- uses: docker/build-push-action@v5
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}

24 changes: 1 addition & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
FROM amazonlinux:latest AS build

RUN yum -y update && rm -rf /var/cache/yum/*
RUN yum install -y \
ca-certificates \
git \
bash \
go

RUN mkdir /aws-sigv4-proxy
WORKDIR /aws-sigv4-proxy
COPY go.mod .
COPY go.sum .

RUN go env -w GOPROXY=direct
RUN go mod download
COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/aws-sigv4-proxy

FROM alpine:3.7
COPY --from=build /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/
COPY --from=build /go/bin/aws-sigv4-proxy /go/bin/aws-sigv4-proxy
FROM gcr.io/distroless/static:nonroot
COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit dbf8184

Please sign in to comment.