deploy #32
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 to Google Cloud | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Authenticate with Google Cloud | |
run: echo '${{ secrets.GCP_SA_KEY }}' > "$HOME/gcp-key.json" | |
- 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 | |
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 |