Skip to content

Commit fee0e5c

Browse files
ci: add docker image publish actions
1 parent 69d87aa commit fee0e5c

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Dream3D image (manual)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Docker tag'
8+
required: true
9+
default: 'dream3d-6.5.171'
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
build-and-push-dream3d:
17+
runs-on: ubuntu-latest
18+
19+
permissions:
20+
contents: read
21+
packages: write
22+
attestations: write
23+
id-token: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v5
28+
29+
- name: Log in to the Container registry
30+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Build and push Dream3D image
37+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
38+
with:
39+
context: .
40+
file: Dockerfile
41+
target: dream3d
42+
push: true
43+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}

.github/workflows/publish.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish the RSE Galaxy image
2+
3+
on:
4+
workflow_run:
5+
workflows: ["pytest"]
6+
types:
7+
- completed
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-and-push-image:
15+
runs-on: ubuntu-latest
16+
if: github.event.workflow_run.conclusion == 'success'
17+
18+
permissions:
19+
contents: read
20+
packages: write
21+
attestations: write
22+
id-token: write
23+
24+
strategy:
25+
matrix:
26+
include:
27+
- branch: main
28+
target: gui
29+
tag-prefix: gui
30+
- branch: cli
31+
target: base
32+
tag-prefix: cli
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v5
37+
38+
- name: Log in to the Container registry
39+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
40+
with:
41+
registry: ${{ env.REGISTRY }}
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Extract metadata
46+
id: meta
47+
if: github.ref_name == matrix.branch
48+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
49+
with:
50+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
tags: |
52+
type=raw,value=${{ matrix.tag-prefix }}-latest
53+
type=sha,prefix=${{ matrix.tag-prefix }}-
54+
55+
- name: Build and push image
56+
if: github.ref_name == matrix.branch
57+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
58+
with:
59+
context: .
60+
file: Dockerfile
61+
target: ${{ matrix.target }}
62+
push: true
63+
tags: ${{ steps.meta.outputs.tags }}
64+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)