-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 31bba4f
Showing
33 changed files
with
1,124 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
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/cholog.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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 0.0 | ||
os: linux | ||
files: | ||
- source: /build/libs/discord-bot.jar | ||
destination: /home/ubuntu/ | ||
|
||
hooks: | ||
AfterInstall: | ||
- location: scripts/deploy.sh | ||
timeout: 300 | ||
runas: ubuntu |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
plugins { | ||
id 'java' | ||
id 'idea' | ||
id 'application' | ||
id 'org.springframework.boot' version '3.3.1' | ||
id 'io.spring.dependency-management' version '1.1.5' | ||
} | ||
|
||
group = 'cholog' | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('javaVersion', JavaVersion.VERSION_21) | ||
} | ||
|
||
java { | ||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2023.0.2") | ||
} | ||
} | ||
|
||
dependencies { | ||
runtimeOnly 'com.h2database:h2' | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' | ||
|
||
implementation 'net.dv8tion:JDA:5.0.0-beta.24' | ||
|
||
implementation 'org.slf4j:slf4j-api' | ||
implementation 'org.slf4j:jcl-over-slf4j' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
} | ||
|
||
springBoot { | ||
mainClass = 'cholog.Application' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.