Skip to content

robinwelin/gae-version-cleanup

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date
Aug 17, 2020
Aug 17, 2020
Jun 24, 2020
Jun 24, 2020
Jun 24, 2020
Jun 24, 2020
Jun 24, 2020
Jun 24, 2020
Jun 25, 2020
Jun 24, 2020
Jun 24, 2020
Sep 13, 2020
Aug 17, 2020
Jun 24, 2020

Repository files navigation

gae-version-cleanup

This action helps you to clean up old versions in Google App Engine.

Usage

- uses: robinwelin/gae-version-cleanup@master
  with:
    GCP_PROJECT: ${{secrets.GCP_PROJECT}}
    GCP_APPLICATION_CREDENTIALS: ${{secrets.GCP_APPLICATION_CREDENTIALS}}
    DRY_RUN: false
    SKIP_ALLOCATED: true
    SKIP_COUNT: 5
    SKIP_UNIQUE: false
    SKIP_UNIQUE_COUNT: 10

Secrets

GCP_PROJECT - (Required) ID of the Google Cloud project

GCP_APPLICATION_CREDENTIALS - (Required) The service account key which will be used for authentication (with permission to App Engine). This key should be created, encoded as a Base64 string (eg. cat my-key.json | base64 on macOS), and stored as a secret

Inputs

DRY_RUN - (Optional) Runs the action and outputs all info, but do not deletes any versions. Defaults to false, allowed values: true, false

SKIP_ALLOCATED - (Optional) Skip versions with traffic allocation. Defaults to true, allowed values: true, false

SKIP_COUNT - (Optional) Skip the newest number of versions. Defaults to 5

SKIP_UNIQUE - (Optional) Skip the newest version each unique date. Defaults to false, allowed values: true, false

SKIP_UNIQUE_COUNT - (Optional) Skip the newest version for the number of unqie dates. Defaults to 10

Full example

name: Google App Engine Version Cleanup
on:
  push:
    branches:
      - master
jobs:
  deploy:
    name: 'GAE Version Cleanup'
    runs-on: [ubuntu-latest]
    steps:
      - uses: robinwelin/gae-version-cleanup@master
        with:
          GCP_PROJECT: ${{secrets.GCP_PROJECT}}
          GCP_APPLICATION_CREDENTIALS: ${{secrets.GCP_APPLICATION_CREDENTIALS}}
          SKIP_UNIQUE: true
          SKIP_UNIQUE_COUNT: 20

Full example multiple GCP projects with same service account

name: Google App Engine Version Cleanup
on:
  push:
    branches:
      - master
jobs:
  deploy:
    name: 'GAE Version Cleanup'
    runs-on: [ubuntu-latest]
    strategy:
      matrix:
        GCP_PROJECTS: [project_1, project_2, project_3]
    steps:
      - name: Running cleanup for ${{ matrix.GCP_PROJECTS }}
        uses: robinwelin/gae-version-cleanup@master
        with:
          GCP_PROJECT: ${{ matrix.GCP_PROJECTS }}
          GCP_APPLICATION_CREDENTIALS: ${{secrets.GCP_SERVICE_ACCOUNT}}
          SKIP_UNIQUE: true
          SKIP_UNIQUE_COUNT: 20

Licence

MIT License