diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 961d7ed..fcca4f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: name: Build Docker image needs: test runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} steps: - uses: actions/checkout@v4 @@ -52,7 +54,7 @@ jobs: - name: Get version number id: version - run: echo "VERSION=$(cat ./package.json | jq -r '.version')" >> $GITHUB_ENV + run: echo "version=$(cat ./package.json | jq -r '.version')" >> $GITHUB_OUTPUT - name: Build Docker image run: | @@ -68,7 +70,7 @@ jobs: name: Push Docker image to DockerHub needs: build runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + # if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - name: Download Docker image uses: actions/download-artifact@v3 @@ -85,4 +87,4 @@ jobs: password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Push Docker image - run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ env.VERSION }} + run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ needs.build.outputs.version }}