π· νμΌ destination λ³κ²½ #32
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
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 |