Skip to content

Commit

Permalink
fix(): update pipeline to upload on dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGioioso committed Apr 23, 2024
1 parent 406dcae commit 1d499c1
Show file tree
Hide file tree
Showing 8 changed files with 1,696 additions and 5,572 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-region: ap-southeast-1
role-to-assume: ${{ secrets.AWS_ROLE_FOR_GITHUB }}
role-session-name: GitHubActions
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
Expand All @@ -37,7 +31,8 @@ jobs:
GITHUB_USERNAME: MatteoGioioso
GITHUB_EMAIL: gioioso.matteo@gmail.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_REGION: ap-southeast-1
ECR_REPOSITORY_URL: public.ecr.aws/hirvitek
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_REPOSITORY: ${{ secrets.DOCKER_USERNAME }}/saml-proxy
HELM_EXPERIMENTAL_OCI: 1
ENV: prod
36 changes: 30 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/bitnami/golang:1.16 AS builder
FROM golang:1.20 AS builder

COPY src/go.mod src/go.sum ./
RUN unset GOPATH && go mod tidy && go mod download
Expand All @@ -8,14 +8,38 @@ FROM builder AS builder-02
COPY src/. .
RUN unset GOPATH && CGO_ENABLED=0 go build -o bin/main .

FROM public.ecr.aws/micahhausler/alpine:3.14.0
RUN apk -U upgrade
RUN addgroup -S saml-proxy --gid 1000 && adduser -S saml-proxy --uid 1000 -G saml-proxy
FROM ubuntu:20.04 AS final

ARG GIN_MODE=release
ARG USER=saml-proxy
ARG GROUP=saml
ARG UID=1001
ARG GID=1001

ENV GIN_MODE=$GIN_MODE
ENV USER=$USER
ENV GROUP=$GROUP
ENV UID=$UID
ENV GID=$GID

RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get upgrade -y

RUN addgroup $GROUP
RUN adduser \
--disabled-password \
--gecos "" \
--home "$(pwd)" \
--ingroup "$GROUP" \
--no-create-home \
--uid "$UID" \
"$USER"


COPY --from=builder-02 /go/bin/main /saml-proxy/main
RUN chown -R saml-proxy:saml-proxy /saml-proxy
RUN chown -R $GID:$UID /saml-proxy

USER 1000
USER $USER

EXPOSE 9000

Expand Down
2 changes: 1 addition & 1 deletion charts/saml-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ config:
protocol: https

image:
repository: public.ecr.aws/hirvitek/saml-proxy
repository: matteogioioso/saml-proxy
pullPolicy: Always
tag: latest

Expand Down
Loading

0 comments on commit 1d499c1

Please sign in to comment.