Skip to content

application.properties 업로드 #4

application.properties 업로드

application.properties 업로드 #4

Workflow file for this run

name: Deploy to App Runner - Source # Name of the workflow
on:
push:
branches: [ main ] # Trigger workflow on git push to main branch
workflow_dispatch: # Allow manual invocation of the workflow
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: |
./gradlew build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1 # Configure with AWS Credentials
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: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: weather_app
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- name: Deploy to App Runner
id: deploy-apprunner
uses: awslabs/amazon-app-runner-deploy@main
env:
weather-API-Key = ${{ secrets.WEATHER_API_KEY }}
papago-client-ID = ${{ secrets.PAPAGO_CLIENT_ID }}
papago-client-SECRET = ${{ secrets.PAPAGO_CLIENT_SECRET }}
with:
service: weather-app
access-role-arn: ${{ secrets.AWS_CONNECTION_SOURCE_ARN }}
runtime: NODEJS_16
region: ${{ secrets.AWS_REGION }}
cpu : 1
memory : 2
port: 8080
copy-env-vars: /
weather-API-Key
papago-client-ID
papago-client-SECRET
wait-for-service-stability: 1200
- name: App Runner output
run: echo "App runner output ${{ steps.deploy-apprunner.outputs.service-id }}"