Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: deploy to development
permissions:
id-token: write
contents: read
on:
on:
push:
branches: [develop]
jobs:
Expand All @@ -23,12 +23,10 @@ jobs:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: install deps and build
## TODO: Move all building into the docker container
- name: install deps
run: |
go mod download
GOOS=linux GOARCH=amd64 go build -o ./cmd/app/main ./cmd/app/main.go


- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
Expand All @@ -39,13 +37,14 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: tag and push to Amazon ECR
- name: build,tag and push to Amazon ECR
env:
ECR_REPO: ${{ secrets.AWS_ACCT }}.dkr.ecr.us-west-2.amazonaws.com
SERVICE: string-api
IMAGE_TAG: latest
run: |
docker build -t $ECR_REPO/$SERVICE:$IMAGE_TAG ./cmd/app/
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./cmd/app/main ./cmd/app/main.go
docker build --platform linux/amd64 -t $ECR_REPO/$SERVICE:$IMAGE_TAG ./cmd/app/
docker push $ECR_REPO/$SERVICE:$IMAGE_TAG

- name: deploy
Expand All @@ -54,5 +53,4 @@ jobs:
SERVICE: string-api
AWS_REGION: us-west-2
run: |
aws ecs --region $AWS_REGION update-service --cluster $CLUSTER --service $SERVICE --force-new-deployment

aws ecs --region $AWS_REGION update-service --cluster $CLUSTER --service $SERVICE --force-new-deployment