Perform scrapping to get last database version #377
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 App Engine | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
setup-app-engine: | |
name: Prepare for App Engine | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry self add poetry-plugin-export | |
poetry export -f requirements.txt --output requirements.txt --only main | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: requirements | |
path: requirements.txt | |
deploy-production-app-engine: | |
name: Deploy App Engine (production) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" # for OpenID Connect JWT Token | |
needs: setup-app-engine | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: "auth" | |
uses: "google-github-actions/auth@v2" | |
with: | |
workload_identity_provider: ${{ secrets.OIDC_PROVIDER }} | |
service_account: ${{ secrets.GCP_SA }} | |
- name: Get requirements.txt | |
uses: actions/download-artifact@v4 | |
with: | |
name: requirements | |
- id: "deploy" | |
uses: "google-github-actions/deploy-appengine@v2" | |
with: | |
flags: "--no-cache" | |
- name: "Clean temporary container images" | |
run: |- | |
gcloud container images list --repository=eu.gcr.io/noplp-stats/app-engine-tmp/app/default \ | |
--format="value(name)" | xargs -I {} sh -c 'gcloud container images delete {} --quiet --force-delete-tags' | |
deploy-pr-app-engine: | |
name: Deploy App Engine (dev PR) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" # for OpenID Connect JWT Token | |
needs: setup-app-engine | |
environment: pull_request | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: "auth" | |
uses: "google-github-actions/auth@v2" | |
with: | |
workload_identity_provider: ${{ secrets.OIDC_PROVIDER }} | |
service_account: ${{ secrets.GCP_SA }} | |
- name: Get requirements.txt | |
uses: actions/download-artifact@v4 | |
with: | |
name: requirements | |
- id: "deploy" | |
uses: "google-github-actions/deploy-appengine@v2" | |
with: | |
flags: "--no-cache" | |
promote: false | |
- name: Show PR environment URL | |
run: 'echo "${{ steps.deploy.outputs.version_url }}"' | |
- name: "Clean temporary container images" | |
run: |- | |
gcloud container images list --repository=eu.gcr.io/noplp-stats/app-engine-tmp/app/default \ | |
--format="value(name)" | xargs -I {} sh -c 'gcloud container images delete {} --quiet --force-delete-tags' |