-
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
1 parent
0c291af
commit f254319
Showing
1 changed file
with
12 additions
and
26 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 |
---|---|---|
@@ -1,37 +1,23 @@ | ||
name: Deploy to Google Cloud | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Java | ||
- name: Set up Java JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '11' | ||
java-version: 11 | ||
|
||
- name: Authenticate with Google Cloud | ||
run: echo '${{ secrets.GCP_SA_KEY }}' > "$HOME/gcp-key.json" | ||
- name: Install Maven | ||
run: sudo apt-get install -y maven | ||
|
||
- name: Find Maven project directory | ||
run: | | ||
echo "Current directory:" | ||
pwd | ||
echo "List of directories containing pom.xml:" | ||
find . -name pom.xml -exec dirname {} \; | ||
- name: Activate service account credentials | ||
- name: Authenticate with Google Cloud | ||
run: gcloud auth activate-service-account --key-file="$HOME/gcp-key.json" | ||
|
||
- name: Change directory and deploy | ||
run: | | ||
cd "$project_dir" | ||
mvn clean package appengine:deploy | ||
- name: List contents of project directory | ||
run: ls -la "$project_dir" | ||
|
||
- name: Build and deploy with Maven | ||
run: mvn clean package appengine:deploy |