add request body annotation #8
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: Discord Bot Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/**' | |
- 'build.gradle' | |
- 'settings.gradle' | |
- 'scrpts/**' | |
- 'src/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '21' | |
- name: Create application.yml | |
env: | |
APPLICATION_YML: ${{ secrets.APPLICATION_YML }} | |
run: | | |
echo "$APPLICATION_YML" | envsubst > src/main/resources/application.yml | |
- name: Build with Gradle | |
run: ./gradlew bootJar | |
- name: Create deploy package | |
run: | | |
mkdir -p scripts | |
zip -r deployment-package.zip build/libs/discord-bot.jar appspec.yml scripts/ | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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: Upload to S3 | |
run: | | |
aws s3 cp deployment-package.zip s3://${{ secrets.S3_BUCKET_NAME }}/deployment-package.zip | |
- name: Deploy to CodeDeploy | |
run: | | |
aws deploy create-deployment \ | |
--application-name ${{ secrets.APPLICATION_NAME }} \ | |
--deployment-group-name ${{ secrets.DEPLOYMENT_GROUP_NAME }} \ | |
--s3-location bucket=${{ secrets.S3_BUCKET_NAME }},key=deployment-package.zip,bundleType=zip |