Skip to content

inspiration

inspiration #32

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: 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/aws-codebuild-run-build@v1.0.3
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