Skip to content

Commit

Permalink
👷(build) create version.json files on both backend and frontend on push
Browse files Browse the repository at this point in the history
This supplements the release process. We inject Github metadata into two
version.json files; the 'version' value will depend on the type of event,
for release tag events it should be the same as the release tag (i.e. the
app version). This should make version information available to the /config
endpoint on any push, and the frontend should display the backend version.
(For extra safety we will also want to get the frontend version and display
that, but this commit only supplies the barest necessities.)
  • Loading branch information
Laurent Bossavit authored and Laurent Bossavit committed Nov 15, 2024
1 parent 90a3e26 commit ed9b51b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ jobs:
name: Login to DockerHub
if: github.event_name != 'pull_request'
run: echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
- name: create-version-json
id: create-version-json
uses: jsdaniell/[email protected]
with:
name: "version.json"
json: '{"source":"${{github.repository}}", "version":"${{github.ref_name}}", "commit":"${{github.sha}}", "build": "NA"}'
dir: 'src/backend'
-
name: Build and push
uses: docker/build-push-action@v6
Expand Down Expand Up @@ -127,6 +134,13 @@ jobs:
with:
secret-file: secrets/numerique-gouv/people/secrets.enc.env
age-key: ${{ secrets.SOPS_PRIVATE }}
- name: create-version-json
id: create-version-json
uses: jsdaniell/[email protected]
with:
name: "version.json"
json: "{'source':'${{github.repository}}', 'version':${{github.ref_name}}, 'commit':${{github.sha}}, 'build': 'NA'}"
dir: 'src/frontend/apps/desk'
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
Expand Down

0 comments on commit ed9b51b

Please sign in to comment.