forked from uswitch/sqs-autoscaler-controller
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ Razorpay SQS Autoscaler ] Add github actions (#3)
* [ Razorpay SQS Autoscaler ] Add github actions
- Loading branch information
1 parent
e38a4ca
commit 7cfc417
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |