|
8 | 8 | default: 'LATEST'
|
9 | 9 | required: false
|
10 | 10 | type: string
|
| 11 | + force-download-artifact: |
| 12 | + description: 'Force download artifact' |
| 13 | + required: false |
| 14 | + type: string |
| 15 | + default: "true" |
11 | 16 | workflow_call:
|
12 | 17 | inputs:
|
13 | 18 | plugin-version:
|
14 | 19 | description: "Kestra version"
|
15 | 20 | default: 'LATEST'
|
16 | 21 | required: false
|
17 | 22 | type: string
|
| 23 | + force-download-artifact: |
| 24 | + description: 'Force download artifact' |
| 25 | + required: false |
| 26 | + type: string |
| 27 | + default: "true" |
18 | 28 | secrets:
|
19 | 29 | DOCKERHUB_USERNAME:
|
20 | 30 | description: "The Dockerhub username."
|
|
24 | 34 | required: true
|
25 | 35 |
|
26 | 36 | jobs:
|
27 |
| - |
| 37 | + # ******************************************************************************************************************** |
| 38 | + # Build |
| 39 | + # ******************************************************************************************************************** |
| 40 | + build-artifacts: |
| 41 | + name: Build Artifacts |
| 42 | + if: ${{ github.event.inputs.force-download-artifact == 'true' }} |
| 43 | + uses: ./.github/workflows/workflow-build-artifacts.yml |
| 44 | + # ******************************************************************************************************************** |
| 45 | + # Docker |
| 46 | + # ******************************************************************************************************************** |
28 | 47 | publish:
|
29 | 48 | name: Publish - Docker
|
30 | 49 | runs-on: ubuntu-latest
|
| 50 | + needs: build-artifacts |
| 51 | + if: | |
| 52 | + always() && |
| 53 | + (needs.build-artifacts.result == 'success' || |
| 54 | + github.event.inputs.force-download-artifact != 'true') |
31 | 55 | strategy:
|
32 | 56 | matrix:
|
33 | 57 | image:
|
34 |
| - - tag: ${{ needs.build-artifacts.outputs.docker-tag }}-no-plugins |
| 58 | + - tag: -no-plugins |
35 | 59 | packages: jattach
|
36 | 60 | python-libraries: ""
|
37 | 61 |
|
38 |
| - - tag: ${{ needs.build-artifacts.outputs.docker-tag }} |
| 62 | + - tag: "" |
39 | 63 | plugins: ${{ needs.build-artifacts.outputs.plugins }}
|
40 | 64 | packages: python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip jattach
|
41 | 65 | python-libraries: kestra
|
@@ -68,11 +92,18 @@ jobs:
|
68 | 92 | id: vars
|
69 | 93 | run: |
|
70 | 94 | TAG=${GITHUB_REF#refs/*/}
|
71 |
| - if [[ $TAG = "master" || $TAG == v* ]]; then |
| 95 | + if [[ $TAG == v* ]]; then |
| 96 | + TAG="${TAG}"; |
72 | 97 | echo "plugins=${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
|
| 98 | + elif [[ $TAG = "develop" ]]; then |
| 99 | + TAG="develop"; |
| 100 | + echo "plugins=--repositories=https://s01.oss.sonatype.org/content/repositories/snapshots ${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT |
73 | 101 | else
|
| 102 | + TAG="build-${{ github.run_id }}"; |
74 | 103 | echo "plugins=--repositories=https://s01.oss.sonatype.org/content/repositories/snapshots ${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
|
75 | 104 | fi
|
| 105 | + |
| 106 | + echo "tag=${TAG}${{ matrix.image.tag }}" >> $GITHUB_OUTPUT |
76 | 107 |
|
77 | 108 | # Build Docker Image
|
78 | 109 | - name: Artifacts - Download executable
|
|
92 | 123 | with:
|
93 | 124 | context: .
|
94 | 125 | push: true
|
95 |
| - tags: kestra/kestra:${{ matrix.image.tag }} |
| 126 | + tags: kestra/kestra:${{ steps.vars.outputs.tag }} |
96 | 127 | platforms: linux/amd64,linux/arm64
|
97 | 128 | build-args: |
|
98 | 129 | KESTRA_PLUGINS=${{ steps.vars.outputs.plugins }}
|
|
0 commit comments