|
4 | 4 | - cron: '0 0 * * *' # Run every day at midnight UTC |
5 | 5 |
|
6 | 6 | workflow_dispatch: # Allow manual run |
7 | | - inputs: |
8 | | - tag: |
9 | | - required: true |
10 | | - type: string |
11 | | - description: Tag with released version |
12 | 7 |
|
13 | 8 | workflow_call: # Allow other GitHub workflows to call this |
14 | 9 | inputs: |
| 10 | + invoked_by: |
| 11 | + required: true |
| 12 | + type: string |
15 | 13 | tag: |
16 | 14 | required: true |
17 | 15 | type: string |
18 | 16 |
|
19 | 17 | env: |
20 | 18 | DOCKER_IMAGE_NAME: thevirtualbrain/tvb-run |
21 | | - DOCKER_EBRAINS_REGISTRY: https://docker-registry.ebrains.eu/v2 |
| 19 | + DOCKER_EBRAINS_REGISTRY: docker-registry.ebrains.eu |
22 | 20 | DOCKER_IMAGE_NAME_EBRAINS: docker-registry.ebrains.eu/tvb/tvb-run |
23 | 21 |
|
24 | 22 | jobs: |
|
41 | 39 |
|
42 | 40 | - name: Login to EBRAINS Docker Registry |
43 | 41 | uses: docker/login-action@v3 |
| 42 | + continue-on-error: true |
44 | 43 | with: |
45 | 44 | registry: ${{ env.DOCKER_EBRAINS_REGISTRY }} |
46 | 45 | username: ${{ secrets.EBRAINS_DOCKER_HUB_USERNAME }} |
|
66 | 65 | # For intermediate builds, an alfa tag will be generated eg: branch_name.alpha |
67 | 66 | id: get_tag |
68 | 67 | run: | |
69 | | - if ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}; then |
| 68 | + if ${{ inputs.invoked_by == 'release' }}; then |
70 | 69 | echo "TAG=${{ inputs.tag }}" >> $GITHUB_OUTPUT |
71 | 70 | else |
72 | 71 | echo "TAG=${{ github.ref_name }}.alpha" >> $GITHUB_OUTPUT |
|
84 | 83 | ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.get_tag.outputs.TAG }} |
85 | 84 | ${{ env.DOCKER_IMAGE_NAME }}:latest |
86 | 85 | ${{ env.DOCKER_IMAGE_NAME_EBRAINS }}:${{ steps.get_tag.outputs.TAG }} |
87 | | - |
| 86 | + cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_NAME }}:buildcache |
| 87 | + cache-to: type=registry,ref=${{ env.DOCKER_IMAGE_NAME }}:buildcache,mode=max |
88 | 88 |
|
0 commit comments