feat/fix: Board 공개여부 관련 API 구현 및 수정 #196 #26
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: Deploy Server | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.ACTION_TOKEN }} | |
submodules: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | |
settings-path: ${{ github.workspace }} # location for the settings.xml file | |
- uses: mirromutth/[email protected] | |
with: | |
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld | |
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld | |
mysql version: '8.0.33' # Optional, default value is "latest". The version of the MySQL | |
mysql database: 'strcat' # Optional, default value is "test". The specified database which will be create | |
mysql user: 'strcat42' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too | |
mysql password: ${{ secrets.SPRING_DATASOURCE_PASSWORD }} # Required if "mysql user" exists. The password for the "mysql user" | |
- name: Set Gradle | |
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | |
- name: Copy Application-Properties | |
run: | | |
mkdir -p src/main/resources | |
cp Back-end-secret/application.properties src/main/resources/application.properties | |
- name: Build Gradle | |
run: ./gradlew build | |
- name: Get current time | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
utcOffset: "+09:00" | |
- name: Generate deployment package # (1) | |
run: | | |
mkdir -p deploy | |
cp build/libs/*-0.0.1-SNAPSHOT.jar deploy/application.jar | |
cp Procfile deploy/Procfile | |
cp Back-end-secret/application-dev.properties deploy/application-dev.properties | |
mkdir -p deploy/.ebextensions | |
cp -r .ebextensions/build-dev.config deploy/.ebextensions/build.config | |
cd deploy && zip -r deploy.zip . | |
- name: Deploy to EB # (2) | |
uses: einaregilsson/beanstalk-deploy@v14 | |
with: | |
aws_access_key: ${{ secrets.AWS_DEV_ACCESS_KEY }} | |
aws_secret_key: ${{ secrets.AWS_DEV_SECRET_KEY }} | |
application_name: strcat-dev | |
environment_name: Strcat-dev-env | |
version_label: github-action-${{steps.current-time.outputs.formattedTime}} | |
region: ap-northeast-2 | |
deployment_package: deploy/deploy.zip |