Merge pull request #924 from darkmatter18/renovate/express-rate-limit… #151
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: GAE Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
check_change_in_web: | |
name: Check changes in WEB | |
outputs: | |
run_job: ${{ steps.check_files.outputs.run_job }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
fetch-depth: 2 | |
- name: check modified files | |
id: check_files | |
run: | | |
echo "=============== list modified files ===============" | |
git diff --name-only HEAD^ HEAD | |
echo "========== check paths of modified files ==========" | |
git diff --name-only HEAD^ HEAD > files.txt | |
while IFS= read -r file | |
do | |
echo $file | |
if [[ $file != web/* ]]; then | |
echo "This modified file is not under the 'web' folder." | |
echo "::set-output name=run_job::false" | |
break | |
else | |
echo "::set-output name=run_job::true" | |
fi | |
done < files.txt | |
build: | |
name: V1 Build & Deploy | |
needs: check_change_in_web | |
if: needs.check.outputs.run_job == 'true' | |
runs-on: ubuntu-latest | |
env: | |
dir: ./web | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Node Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 12 | |
- name: GAE Setup | |
uses: google-github-actions/setup-gcloud@master | |
with: | |
project_id: ${{ secrets.PROJECT_ID }} | |
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS}} | |
- name: NPM Install WWW | |
run: npm ci | |
working-directory: ${{env.dir}} | |
- name: Build WWW | |
run: npm run build | |
working-directory: ${{env.client}} | |
# Deploy App to App Engine | |
- name: Deploy | |
run: | | |
gcloud app deploy web/app.yaml dispatch.yaml --quiet |