Skip to content

Commit dab591e

Browse files
committed
PYCBC-1775: Add GHA workflows for building & pruning performer images
Changes ======= * Add GHA job for building performer images for every new tag, or push to master or release branches. * Add GHA job for pruning stale temporary performer images. These are images built for a PR or Gerrit patch that are older than 7 days. Change-Id: Ic032c88a3fcc7959a900159bc15e64aafa511eac Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/250544 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Jared Casey <jared.casey@couchbase.com>
1 parent 3025e05 commit dab591e

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Prune Stale Images
2+
3+
on:
4+
schedule:
5+
- cron: '35 3 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
prune:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
14+
steps:
15+
- name: Prune old temporary FIT performer images
16+
uses: vlaurin/action-ghcr-prune@v0.6.0
17+
with:
18+
token: ${{ github.token }}
19+
organization: ${{ github.repository_owner }}
20+
container: python-fit-performer
21+
keep-younger-than: 7 # days
22+
prune-untagged: true
23+
prune-tags-regexes: |
24+
^refs-
25+
^sha-
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish FIT Performer
2+
permissions: {}
3+
4+
run-name: ${{ inputs.ref }}
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.ref }}
8+
cancel-in-progress: true
9+
10+
on:
11+
push:
12+
branches:
13+
- master
14+
- release*
15+
16+
tags:
17+
- '*'
18+
19+
workflow_dispatch:
20+
inputs:
21+
ref:
22+
description: "Performer version. Specify a branch, tag, full commit hash, GitHub PR like 'refs/pull/37/merge', or Gerrit change like 'refs/changes/58/240858/6'"
23+
required: true
24+
25+
jobs:
26+
publish:
27+
name: Build & Publish Docker Image
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
33+
steps:
34+
- uses: couchbaselabs/sdk-docker-build-action@v1
35+
with:
36+
sdk: python
37+
ref: ${{ inputs.ref }}
38+
dockerfile: ./tools/fit_performer/Dockerfile
39+
env:
40+
DOCKER_BUILD_SUMMARY: false

0 commit comments

Comments
 (0)