Bump tempfile from 0.2.1 to 0.3.0 (#181) #230
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: Google Cloud | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '.github/**' | |
- '**.md' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Authenticate with Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v0 | |
with: | |
credentials_json: ${{ secrets.GCP_SA_KEY }} | |
- name: Deploy to App Engine | |
uses: google-github-actions/[email protected] | |
with: | |
deliverables: app.yaml | |
- name: Delete old versions in App Engine | |
run: | | |
INSTANCE_TYPE="default" | |
VERSIONS_TO_KEEP=1 | |
VERSIONS=`gcloud app versions list --service $INSTANCE_TYPE --sort-by '~version' --format 'value(version.id)' | sort -r | tail -n +$(($VERSIONS_TO_KEEP + 1)) | paste -sd " " -` | |
if [ ${#VERSIONS} -gt 0 ]; then | |
delete_cmd="gcloud app versions delete --service $INSTANCE_TYPE $VERSIONS -q" && eval $delete_cmd; | |
fi |