Skip to content
Open
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
63 changes: 63 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build and Push

on:
push:
branches:
- dev

env:
ECR_REGISTRY: ${{ secrets.VOLOMN_AWS_ECR_REGISTRY }}
ECR_FRONTEND_REPOSITORY: voauth_web
ECR_BACKEND_REPOSITORY: voauth_api
IMAGE_TAG: ${{ github.sha }}

jobs:
build-push-frontend:
name: Build and Push Frontend Docker Image
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.VOLOMN_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.VOLOMN_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build Frontend Docker Image
run: |
cd frontend
docker build --build-arg API_BASE_URL=${{ secrets.API_BASE_URL }} -t $ECR_REGISTRY/$ECR_FRONTEND_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_FRONTEND_REPOSITORY:$IMAGE_TAG

build-push-backend:
name: Build and Push Backend Docker Image
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.VOLOMN_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.VOLOMN_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build Backend Docker Image
run: |
cd backend
docker build -t $ECR_REGISTRY/$ECR_BACKEND_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_BACKEND_REPOSITORY:$IMAGE_TAG