Skip to content

Commit 356c82d

Browse files
committed
ci: refactor to use env variables to avoid duplication
1 parent 97e49ec commit 356c82d

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.github/.devcontainer/devcontainer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
"IMAGE": "${localEnv:IMAGE}"
88
},
99
"options": [
10-
"--label", "org.opencontainers.image.title=Quarto Codespaces",
11-
"--annotation", "org.opencontainers.image.title=Quarto Codespaces",
12-
"--label", "org.opencontainers.image.description=Quarto Codespaces / Dev Containers setup for quick online testing and workshops.",
13-
"--annotation", "org.opencontainers.image.description=Quarto Codespaces / Dev Containers setup for quick online testing and workshops.",
14-
"--label", "org.opencontainers.image.authors=Mickaël CANOUIL <https://mickael.canouil.fr>",
15-
"--annotation", "org.opencontainers.image.authors=Mickaël CANOUIL <https://mickael.canouil.fr>",
16-
"--label", "org.opencontainers.image.url=https://github.com/mcanouil/quarto-codespaces",
17-
"--annotation", "org.opencontainers.image.url=https://github.com/mcanouil/quarto-codespaces",
18-
"--label", "org.opencontainers.image.source=https://github.com/mcanouil/quarto-codespaces",
19-
"--annotation", "org.opencontainers.image.source=https://github.com/mcanouil/quarto-codespaces",
20-
"--label", "org.opencontainers.image.version=${localEnv:VERSION}",
21-
"--annotation", "org.opencontainers.image.version=${localEnv:VERSION}",
22-
"--label", "org.opencontainers.image.licenses=MIT",
23-
"--annotation", "org.opencontainers.image.licenses=MIT"
10+
"--label", "org.opencontainers.image.title=${localEnv:ANNOTATION_TITILE}",
11+
"--annotation", "org.opencontainers.image.title=${localEnv:ANNOTATION_TITILE}",
12+
"--label", "org.opencontainers.image.description=${localEnv:ANNOTATION_DESCRIPTION}",
13+
"--annotation", "org.opencontainers.image.description=${localEnv:ANNOTATION_DESCRIPTION}",
14+
"--label", "org.opencontainers.image.authors=${localEnv:ANNOTATION_AUTHOR}",
15+
"--annotation", "org.opencontainers.image.authors=${localEnv:ANNOTATION_AUTHOR}",
16+
"--label", "org.opencontainers.image.url=${localEnv:ANNOTATION_URL}",
17+
"--annotation", "org.opencontainers.image.url=${localEnv:ANNOTATION_URL}",
18+
"--label", "org.opencontainers.image.source=${localEnv:ANNOTATION_URL}",
19+
"--annotation", "org.opencontainers.image.source=${localEnv:ANNOTATION_URL}",
20+
"--label", "org.opencontainers.image.version=${localEnv:ANNOTATION_VERSION}",
21+
"--annotation", "org.opencontainers.image.version=${localEnv:ANNOTATION_VERSION}",
22+
"--label", "org.opencontainers.image.licenses=${localEnv:ANNOTATION_LICENSE}",
23+
"--annotation", "org.opencontainers.image.licenses=${localEnv:ANNOTATION_LICENSE}"
2424
]
2525
},
2626
"remoteUser": "${localEnv:USER}",

.github/workflows/devcontainer.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ jobs:
9191
IMAGE: ${{ matrix.IMAGE }}
9292
QUARTO_VERSION: ${{ matrix.QUARTO_VERSION }}
9393
USER: ${{ matrix.USER }}
94-
VERSION: ${{ steps.image_version.outputs.VERSION }}
94+
ANNOTATION_VERSION: "${{ steps.image_version.outputs.VERSION }} (${{ github.sha }})"
95+
ANNOTATION_TITLE: "Quarto Codespaces"
96+
ANNOTATION_DESCRIPTION: "Quarto Codespaces / Dev Containers setup for quick online testing and workshops."
97+
ANNOTATION_AUTHORS: "Mickaël CANOUIL <https://mickael.canouil.fr>"
98+
ANNOTATION_URL: ${{ github.server_url }}/${{ github.repository }}
99+
ANNOTATION_LICENSE: "MIT"
95100

96101
build-versions:
97102
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)