Skip to content

πŸ‘· 파일 destination λ³€κ²½ #32

πŸ‘· 파일 destination λ³€κ²½

πŸ‘· 파일 destination λ³€κ²½ #32

Workflow file for this run

name: CI CD
on:
push:
branches: ['lightsail_action']
env:
LIGHTSAIL_SSH_KEY: ${{ secrets.LIGHTSAIL_SSH_KEY }}
LIGHTSAIL_HOST: ${{ secrets.LIGHTSAIL_HOST }}
LIGHTSAIL_USERNAME: bitnami
AWS_REGION: ap-northeast-2
# jobs:
# deploy:
# name: DEPLOY
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Set up JDK 17
# uses: actions/setup-java@v1
# with:
# java-version: 17
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# shell: bash
# - name: Build with Gradle
# run: ./gradlew build
# shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout release
uses: actions/checkout@v3
- name: compress
run: tar cvfz ./$GITHUB_SHA.tar.gz *
shell: bash
# AWS 인증을 μ‹œμž‘ν•©λ‹ˆλ‹€.
- name: AWS μΈμ¦ν•˜κΈ°
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ env.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS 인증이 μ™„λ£Œλ˜μ—ˆλŠ”μ§€ ν…ŒμŠ€νŠΈν•©λ‹ˆλ‹€.
- name: AWS Lightsail에 μ—°κ²°λ˜μ—ˆλŠ”μ§€ 확인
run: aws configure list
- name: upload to S3
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.tar.gz s3://lightsail-github-action-cicd
- name: deploy with AWS codeDeploy
run: aws deploy create-deployment
--application-name aloha-time
--deployment-config-name CodeDeployDefault.OneAtATime
--deployment-group-name AlohaTimeDeploymentGrouop
--s3-location bucket=lightsail-github-action-cicd,bundleType=tgz,key=$GITHUB_SHA.tar.gz