From 096a224b6c7321456fef5cde6d61bb09ccdec0fb Mon Sep 17 00:00:00 2001 From: Yossi Eynav Date: Fri, 15 Dec 2023 15:45:51 +0200 Subject: [PATCH] add version --- .github/workflows/server.yml | 2 ++ server/bin/serve | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 77af3a19..90c7e52f 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -138,6 +138,7 @@ jobs: SERVER_EMAIL_SMTP_AUTH_TEMPLATE_PASS=${{ secrets.SERVER_EMAIL_SMTP_AUTH_TEMPLATE_PASS }} SERVER_EMAIL_DIGEST_PLANS=${{ secrets.SERVER_EMAIL_DIGEST_PLANS }} SERVER_PROXY_API_KEY=${{ secrets.SERVER_PROXY_API_KEY }} + VERSION=${{github.sha}} - name: Deploy Amazon ECS task definition uses: aws-actions/amazon-ecs-deploy-task-definition@df9643053eda01f169e64a0e60233aacca83799a with: @@ -188,6 +189,7 @@ jobs: SERVER_EMAIL_SMTP_AUTH_TEMPLATE_PASS=${{ secrets.SERVER_EMAIL_SMTP_AUTH_TEMPLATE_PASS }} SERVER_EMAIL_DIGEST_PLANS=${{ secrets.SERVER_EMAIL_DIGEST_PLANS }} SERVER_PROXY_API_KEY=${{ secrets.SERVER_PROXY_API_KEY }} + VERSION=${{github.sha}} - name: Deploy Amazon ECS task definition uses: aws-actions/amazon-ecs-deploy-task-definition@df9643053eda01f169e64a0e60233aacca83799a with: diff --git a/server/bin/serve b/server/bin/serve index 3ebc1628..dc0c5361 100644 --- a/server/bin/serve +++ b/server/bin/serve @@ -13,6 +13,13 @@ mainApp.use('/health', (req, res) => { res.sendStatus(200); }) +mainApp.use('/version', (req, res) => { + res.send({ + commit: process.env.VERSION, + url: `https://github.com/meirim-org/meirim/commit/${process.env.VERSION}`, + }); +}) + // mount api and static apps mainApp.get('/test', (req, res) => { res.sendStatus(200) } ) mainApp.use('/api', apiApp);