inspiration #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Docker login | |
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- 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/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 |