Skip to content

Commit 71d2c27

Browse files
committed
fixup
1 parent 0cdff0b commit 71d2c27

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/build-devcontainer.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v6
2525

26+
- name: Compute image path
27+
id: image
28+
run: |
29+
repo_lower=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')
30+
echo "name=ghcr.io/$repo_lower/devcontainer:latest" >> $GITHUB_OUTPUT
31+
2632
- name: Set up Docker Buildx
2733
uses: docker/setup-buildx-action@v3
2834

@@ -40,6 +46,6 @@ jobs:
4046
context: .
4147
file: .devcontainer/Dockerfile
4248
push: ${{ github.event_name != 'pull_request' }}
43-
tags: ghcr.io/${{ github.repository }}/devcontainer:latest
49+
tags: ${{ steps.image.outputs.name }}
4450
cache-from: type=gha
4551
cache-to: type=gha,mode=max

.github/workflows/checks.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
runs-on: ubuntu-latest
7070
permissions:
7171
packages: write
72+
outputs:
73+
image: ${{ steps.image.outputs.name }}
7274
steps:
7375
- name: Checkout repository
7476
uses: actions/checkout@v6
@@ -83,13 +85,20 @@ jobs:
8385
username: ${{ github.actor }}
8486
password: ${{ secrets.GITHUB_TOKEN }}
8587

88+
- name: Compute image path
89+
id: image
90+
run: |
91+
repo_lower=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')
92+
image="ghcr.io/$repo_lower/devcontainer:${{ github.sha }}"
93+
echo "name=$image" >> $GITHUB_OUTPUT
94+
8695
- name: Build and push devcontainer image
8796
uses: docker/build-push-action@v6
8897
with:
8998
context: .
9099
file: .devcontainer/Dockerfile
91100
push: true
92-
tags: ghcr.io/${{ github.repository }}/devcontainer:${{ github.sha }}
101+
tags: ${{ steps.image.outputs.name }}
93102
cache-from: type=gha
94103
cache-to: type=gha,mode=max
95104

@@ -98,7 +107,7 @@ jobs:
98107
needs: build-devcontainer
99108
runs-on: ubuntu-latest
100109
container:
101-
image: ghcr.io/${{ github.repository }}/devcontainer:${{ github.sha }}
110+
image: ${{ needs.build-devcontainer.outputs.image }}
102111
steps:
103112
- name: Checkout repository
104113
uses: actions/checkout@v6
@@ -119,7 +128,7 @@ jobs:
119128
needs: build-devcontainer
120129
runs-on: ubuntu-latest
121130
container:
122-
image: ghcr.io/${{ github.repository }}/devcontainer:${{ github.sha }}
131+
image: ${{ needs.build-devcontainer.outputs.image }}
123132
steps:
124133
- name: Checkout repository
125134
uses: actions/checkout@v6

0 commit comments

Comments
 (0)