Skip to content

Bump golang from 1.22.1-alpine to 1.22.3-alpine in /build (#66) #56

Bump golang from 1.22.1-alpine to 1.22.3-alpine in /build (#66)

Bump golang from 1.22.1-alpine to 1.22.3-alpine in /build (#66) #56

Workflow file for this run

name: Push
on:
push:
branches:
- main
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
defaults:
run:
shell: sh
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.1
- name: Install dependencies
run: go mod tidy
- name: Run Unit Tests
run: go test -v --race --covermode atomic --coverpkg github.com/unofficialopensource-knit/MailerService/internal/app ./internal/app_test/unit/
env:
SMTP_IDENTITY: ${{ secrets.MAILER_SMTP_IDENTITY }}
SMTP_USERNAME: ${{ secrets.MAILER_SMTP_USERNAME }}
SMTP_PASSWORD: ${{ secrets.MAILER_SMTP_PASSWORD }}
SMTP_HOST: ${{ vars.MAILER_SMTP_HOST }}
SMTP_PORT: ${{ vars.MAILER_SMTP_PORT }}
CONTACT_US_DEFAULT_RECIPIENT: ${{ vars.MAILER_CONTACT_US_DEFAULT_RECIPIENT }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.4.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: unofficialopensource-knit/MailerService
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- coverage
defaults:
run:
shell: sh
outputs:
image_tag: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Login to Amazon ECR
uses: docker/login-action@v3
with:
ecr: true
logout: true
registry: 976750617193.dkr.ecr.ap-south-1.amazonaws.com
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: 976750617193.dkr.ecr.ap-south-1.amazonaws.com/wecoach-mailer-service
tags: type=sha
- name: Build
run: docker image build --file build/Dockerfile --tag ${{ steps.meta.outputs.tags }} .
- name: Push
run: docker image push ${{ steps.meta.outputs.tags }}
- name: Redeploy Lambda
run: aws lambda update-function-code --function-name MailerService --image-uri ${{ steps.meta.outputs.tags }}