From 1e6a75687a8e635706cc4e83a446542e62de81b4 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Sat, 17 Jun 2023 01:31:03 +0200 Subject: [PATCH] add package version extraction to docker push job --- .gitea/workflows/docker-build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index eb3985f..fe5fe7a 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -19,9 +19,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Get Package Version + run: VERSION = node -p "require('./package.json').version" - name: Log in to the Container registry run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} - name: Build Container - run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" . + run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}". - name: Push Container run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"