Skip to content

Commit

Permalink
Add build and deploy workflow (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
cseteram authored Jul 16, 2023
1 parent 63bf299 commit 1c6495f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and push image

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ vars.ECR_PUSH_ROLE_ARN }}
aws-region: ap-northeast-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ vars.ECR_URL }}/${{ vars.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 1c6495f

Please sign in to comment.