Skip to content

Commit

Permalink
[ Razorpay SQS Autoscaler ] Add github actions (#3)
Browse files Browse the repository at this point in the history
* [ Razorpay SQS Autoscaler ] Add github actions
  • Loading branch information
telnet-harsha authored Mar 13, 2023
1 parent e38a4ca commit 7cfc417
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Workflow

on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: build
steps:
- name: checkout
id: checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.PUBLIC_DOCKER_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKER_PASSWORD }}
- name: build sqs-autoscaler-controller image
uses: docker/build-push-action@v2
with:
tags: razorpay/sqs-autoscaler-controller:${{ github.sha }}
push: true
file: Dockerfile
build-args: GIT_COMMIT_HASH=${{ github.sha }}
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM scratch
FROM golang:1.20.2-alpine3.17

ADD bin/sqs-autoscaler-controller /sqs-autoscaler-controller

ENTRYPOINT ["/sqs-autoscaler-controller"]
ENV SRC_DIR=/go/src/github.com/razorpay/sqs-autoscaler-controller

WORKDIR $SRC_DIR

ADD . $SRC_DIR/

RUN go mod download && \
CGO_ENABLED=0 GOOS=linux go build -o /bin/sqs-autoscaler-controller main.go && \
chmod +x /bin/sqs-autoscaler-controller

ENTRYPOINT ["/bin/sqs-autoscaler-controller"]

0 comments on commit 7cfc417

Please sign in to comment.