Skip to content

Commit 4577b75

Browse files
authored
Use inline cache for workflows (#872)
## Description ### Summary <!--Brief description of what this PR does.--> ### Related Issues <!-- If applicable --> Closes #<!--0--> ## Changes Made <!--Please describe the changes made in this pull request--> - ... ## Type of Change - [x] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 🔨 Refactor (non-breaking change that neither fixes a bug nor adds a feature) - [ ] 🔧 Infra CI/CD (changes to configs of workflows) - [ ] 💥 BREAKING CHANGE (fix or feature that require a new minimal version of the front-end) ## Impact & Scope - [ ] Core functionality changes - [ ] Single module changes - [ ] Multiple modules changes - [ ] Database migrations required - [x] Other ## Testing - [ ] Added/modified tests that pass the CI - [ ] Tested in a pre-prod - [ ] Tested this locally ## Documentation - [ ] Updated docs accordingly (docs.myecl.fr) : <!--[Docs#0 - Title](https://github.com/aeecleclair/myecl-documentation/pull/0)--> - [ ] Code includes docstrings - [ ] No documentation needed ## Checklist - [ ] My code follows the style guidelines of this project - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] Any dependent changes have been merged and published (_Indicate the linked PR for the dependent changes_) ## Additional Notes Add any other context, screenshots, or information about the pull request here.
1 parent ed8ac0d commit 4577b75

File tree

3 files changed

+18
-25
lines changed

3 files changed

+18
-25
lines changed

.github/workflows/alpha-publish.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ jobs:
1616
with:
1717
ref: "main"
1818

19+
- name: Docker metadata
20+
id: meta
21+
uses: docker/[email protected]
22+
with:
23+
images: ${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion
24+
tags: |
25+
type=raw,value=alpha
26+
1927
- name: Set up Docker Buildx
2028
uses: docker/[email protected]
2129

@@ -26,17 +34,6 @@ jobs:
2634
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
2735
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
2836

29-
- name: Docker metadata
30-
id: meta
31-
uses: docker/[email protected]
32-
with:
33-
images: ${{ secrets.DOCKER_REGISTRY_URL }}/hyperion
34-
tags: |
35-
type=raw,value=alpha
36-
labels: |
37-
preprod.environment=${{ github.event.inputs.preprod_env }}
38-
preprod.branch=${{ github.event.inputs.branch }}
39-
4037
- name: Build and push preprod image
4138
uses: docker/[email protected]
4239
with:
@@ -46,6 +43,6 @@ jobs:
4643
tags: ${{ steps.meta.outputs.tags }}
4744
labels: ${{ steps.meta.outputs.labels }}
4845
cache-from: |
49-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:latest
50-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:alpha
51-
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/${{ github.repository }}/cache,mode=max
46+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:alpha
47+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:latest
48+
cache-to: type=inline

.github/workflows/preprod-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
tags: ${{ steps.meta.outputs.tags }}
6666
labels: ${{ steps.meta.outputs.labels }}
6767
cache-from: |
68-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:${{ github.event.inputs.preprod_env }}
69-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:alpha
70-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:latest
71-
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/${{ github.repository }}/cache,mode=max
68+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:${{ github.event.inputs.preprod_env }}
69+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:alpha
70+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:latest
71+
cache-to: type=inline

.github/workflows/publish.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ jobs:
3434
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
3535
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
3636

37-
- name: Normalize repository name
38-
id: repo
39-
run: echo "repo_lc=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
40-
4137
- name: Build and push app
4238
uses: docker/[email protected]
4339
with:
@@ -47,6 +43,6 @@ jobs:
4743
tags: ${{ steps.meta.outputs.tags }}
4844
labels: ${{ steps.meta.outputs.labels }}
4945
cache-from: |
50-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:alpha
51-
type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/hyperion:latest
52-
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/${{ steps.repo.outputs.repo_lc }}/cache,mode=max
46+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:alpha
47+
type=registry,ref=${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/hyperion:latest
48+
cache-to: type=inline

0 commit comments

Comments
 (0)