Skip to content

Merge pull request #942 from darkmatter18/renovate/npm-mongoose-vulne… #162

Merge pull request #942 from darkmatter18/renovate/npm-mongoose-vulne…

Merge pull request #942 from darkmatter18/renovate/npm-mongoose-vulne… #162

Workflow file for this run

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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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