Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

[WEAV-315] Sentry 라이브러리 연동 (#257) #214

[WEAV-315] Sentry 라이브러리 연동 (#257)

[WEAV-315] Sentry 라이브러리 연동 (#257) #214

name: Develop Server Integrator (CI)
on:
push:
branches:
- main
workflow_dispatch:
inputs:
head:
description: 'Head version number'
required: true
default: '0'
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repository
uses: actions/checkout@v2
- 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: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Get latest tag
id: get_tag
run: |
latest_tag=$(git describe --tags --abbrev=0 --match "[0-9]*.[0-9]*.[0-9]*" 2>/dev/null || echo "0.0.0")
echo "::set-output name=latest_tag::$latest_tag"
- name: Generate HeadVer version
id: generate_version
run: |
IFS='.' read -ra version_parts <<< "${{ steps.get_tag.outputs.latest_tag }}"
head=${{ github.event.inputs.head }}
if [ -z "$head" ]; then
head=${version_parts[0]}
fi
yearweek=$(date +%y%W)
build=${{ github.run_number }}
version="${head}.${yearweek}.${build}"
echo "::set-output name=version::$version"
echo "::set-output name=head::$head"
echo "::set-output name=yearweek::$yearweek"
echo "::set-output name=build::$build"
- name: Build, tag, and push docker image to Amazon ECR Public
env:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: ${{ secrets.ECR_REGISTRY_ALIAS }}
REPOSITORY: weave_server_dev_cr
IMAGE_TAG: ${{ steps.generate_version.outputs.version }}
run: |
docker build -f Dockerfile-http -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker tag $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest
- name: Logout of Amazon ECR
run: docker logout ${{ env.ECR_REGISTRY }}