Update main.yml #74
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 | |
on: | |
push: | |
branches: | |
- master | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build React | |
run: | | |
git submodule update --init --recursive | |
- name: Install Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
java-package: jdk | |
architecture: x64 | |
check-latest: false | |
server-id: github | |
server-username: GITHUB_ACTOR | |
server-password: GITHUB_TOKEN | |
overwrite-settings: true | |
job-status: success | |
distribution: adopt | |
- name: Build Project(without test) | |
run: | | |
echo "spring.datasource.url=jdbc:mysql://34.83.157.18:3306/rank_system" >> src/main/resources/application.properties | |
./gradlew clean build -x test | |
- name: Publish app to Google App Engine | |
uses: zxyle/[email protected] | |
with: | |
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
project_id: ${{ secrets.PROJECT_ID }} | |
- name: Deploy Project | |
run: | | |
echo '${{ secrets.GCP_SA_KEY }}' > key.json | |
gcloud config set project ${{ secrets.PROJECT_ID }} | |
gcloud auth activate-service-account --key-file=key.json --verbosity=debug | |
# gcloud app create --region=us-west1 | |
gcloud app deploy ./build/libs/rank-system-2.0.0-SNAPSHOT.jar --version=v2 --quiet | |