-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (88 loc) · 3.19 KB
/
docker-release.yml
File metadata and controls
100 lines (88 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Release Image
on:
workflow_dispatch:
inputs:
container:
description: 'Container to release'
required: true
type: choice
options:
- ttyd
- streamlit
- cellxgene
- shiny
- marimo
version:
description: 'Version to release (e.g., 1.0.0)'
required: true
type: string
# renovate: datasource=docker depName=public.cr.seqera.io/platform/connect-client
connect_client_version:
description: 'Version of connect-client to use (e.g., 0.9)'
required: false
type: string
default: '0.9'
env:
REGISTRY: ghcr.io
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set container path
id: container
run: |
case "${{ inputs.container }}" in
ttyd) echo "path=./ttyd" >> "$GITHUB_OUTPUT" ;;
streamlit) echo "path=./streamlit" >> "$GITHUB_OUTPUT" ;;
cellxgene) echo "path=./cellxgene" >> "$GITHUB_OUTPUT" ;;
shiny) echo "path=./shiny-simple-example" >> "$GITHUB_OUTPUT" ;;
marimo) echo "path=./marimo" >> "$GITHUB_OUTPUT" ;;
esac
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.container }}
tags: |
type=raw,value=${{ inputs.version }}
type=raw,value=latest
labels: |
org.opencontainers.image.description=Custom Studios Example Container for ${{ inputs.container }}
org.opencontainers.image.licenses=MIT
- name: Build and push ${{ inputs.container }}
uses: docker/build-push-action@v5
with:
context: ${{ steps.container.outputs.path }}
push: true
platforms: linux/amd64
build-args: |
CONNECT_CLIENT_VERSION=${{ inputs.connect_client_version || '0.9' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ inputs.container }}
cache-to: type=gha,mode=max,scope=${{ inputs.container }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.container }}/${{ inputs.version }}
name: ${{ inputs.container }} ${{ inputs.version }}
body: |
## ${{ inputs.container }} ${{ inputs.version }}
Image: `${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.container }}:${{ inputs.version }}`
```bash
docker pull ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.container }}:${{ inputs.version }}
```
generate_release_notes: true