Skip to content

inspiration

inspiration #41

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: inspiration
on:
workflow_dispatch:
env:
S3_BUCKET_NAME: ygt-bucket-2024-04
PROJECT_LOCATION: deploy
PROJECT_NAME: inspiration
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Make Directory for deliver
run: mkdir deploy
# appspec.yml Copy
- name: Copy appspec
run: cp ./appspec.yml ./deploy/
# Dockerfile Copy
- name: Copy Dockerfile
run: cp ./docker-compose.yml ./deploy/
# script file Copy
- name: Copy shell
run: |
mkdir deploy/scripts
cp ./scripts/* ./deploy/scripts/
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Docker push
run: |
cd module-web
docker build -t ${{ secrets.DOCKER_REPOSITORY_PROD }} .
docker push ${{ secrets.DOCKER_REPOSITORY_PROD }}
- name: Make zip file
run: zip -r ./$GITHUB_SHA.zip ./deploy/
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Setup CodeBuild
uses: aws-actions/[email protected]
with:
project-name: ygtang-build-production
- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$PROJECT_LOCATION/$PROJECT_NAME/$GITHUB_SHA.zip
- name: Code Deploy
run: aws deploy create-deployment --application-name ygt-code-deploy --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ygt-prod-deploy --s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$PROJECT_LOCATION/$PROJECT_NAME/$GITHUB_SHA.zip