-
Notifications
You must be signed in to change notification settings - Fork 44
138 lines (120 loc) · 4.17 KB
/
publish.yml
File metadata and controls
138 lines (120 loc) · 4.17 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Publish Release
on:
release:
types: [published]
jobs:
run-tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
run-integration-tests:
uses: ./.github/workflows/integration-tests.yml
secrets: inherit
run-build:
uses: ./.github/workflows/build.yml
secrets: inherit
needs:
- run-tests
- run-integration-tests
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sunbeamlib
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
needs: run-build
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish-to-dockerhub:
name: >-
Publish Docker 🐳 image 📦 to Docker Hub
if: startsWith(github.ref, 'refs/tags/') # only publish to Docker Hub on tag pushes
runs-on: ubuntu-latest
needs: run-build
steps:
- uses: actions/checkout@v5
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: sunbeamlabs/sunbeam
- name: Build and push full image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
sunbeamlabs/sunbeam:latest
sunbeamlabs/sunbeam:${{ github.ref_name }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push slim image
uses: docker/build-push-action@v6
with:
context: .
file: ./slim.Dockerfile
push: true
tags: sunbeamlabs/sunbeam:${{ github.ref_name }}-slim
labels: ${{ steps.meta.outputs.labels }}
- name: Extract cutadapt Docker metadata
id: meta-cutadapt
uses: docker/metadata-action@v5
with:
images: sunbeamlabs/cutadapt
tags: |
sunbeamlabs/cutadapt:${{ github.ref_name }}
sunbeamlabs/cutadapt:latest
- name: Build and push cutadapt image
uses: docker/build-push-action@v6
with:
context: .
file: sunbeam/workflow/envs/cutadapt.Dockerfile
push: true
tags: ${{ steps.meta-cutadapt.outputs.tags }}
labels: ${{ steps.meta-cutadapt.outputs.labels }}
- name: Extract komplexity Docker metadata
id: meta-komplexity
uses: docker/metadata-action@v5
with:
images: sunbeamlabs/komplexity
tags: |
sunbeamlabs/komplexity:${{ github.ref_name }}
sunbeamlabs/komplexity:latest
- name: Build and push komplexity image
uses: docker/build-push-action@v6
with:
context: .
file: sunbeam/workflow/envs/komplexity.Dockerfile
push: true
tags: ${{ steps.meta-komplexity.outputs.tags }}
labels: ${{ steps.meta-komplexity.outputs.labels }}
- name: Extract QC Docker metadata
id: meta-qc
uses: docker/metadata-action@v5
with:
images: sunbeamlabs/qc
tags: |
sunbeamlabs/qc:${{ github.ref_name }}
sunbeamlabs/qc:latest
- name: Build and push QC image
uses: docker/build-push-action@v6
with:
context: .
file: sunbeam/workflow/envs/qc.Dockerfile
push: true
tags: ${{ steps.meta-qc.outputs.tags }}
labels: ${{ steps.meta-qc.outputs.labels }}