Skip to content

Commit 24a5bcc

Browse files
committed
Add postprocessing image creation github action and call it from isort
1 parent d3f934a commit 24a5bcc

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

.github/workflows/isort.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
uses: ./.github/workflows/black.yml
4747

4848
# Ensure publish-image runs after Black and Isort have completed
49-
publish-image:
49+
publish-utils-image:
5050
needs: [isort, black]
51-
uses: ./.github/workflows/publish-image.yml
51+
uses: ./.github/workflows/publish-utils-image.yml
52+
53+
# Ensure publish-custom-tasks-image runs after Black and Isort have completed
54+
publish-custom-tasks-image:
55+
needs: [isort, black]
56+
uses: ./.github/workflows/publish-custom-tasks-image.yml
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish custom tasks image to Github Packages
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
# Do not run on pushes to main, because this is separately triggred on pushes to main by the
7+
# isort workflow, and we want to make sure it runs after isort, and not twice
8+
- main
9+
workflow_call:
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: open-forest-observatory/argo-workflow-custom-tasks
14+
15+
jobs:
16+
build-and-push-image:
17+
if: github.repository == 'open-forest-observatory/ofo-argo'
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: read
22+
packages: write
23+
attestations: write
24+
id-token: write
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract metadata (tags, labels) for Docker
38+
id: meta
39+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
tags: |
43+
# Tag with branch name on branch pushes
44+
type=ref,event=branch
45+
type=ref,event=tag
46+
type=ref,event=pr
47+
# Only apply latest tag to main branch
48+
type=raw,value=latest,enable={{is_default_branch}}
49+
50+
- name: Build and push Docker image
51+
id: push
52+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
53+
with:
54+
context: ./workflow-custom-tasks
55+
push: true
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)