diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 613c23d..616cb05 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -10,19 +10,17 @@ jobs: packages: write steps: - uses: actions/checkout@v4 - with: - token: ${{ secrets.REPO_SCOPED_TOKEN }} - + - name: Fetch release version of ProfitTrailer id: remote-check run: | echo ::set-output name=remote_tag_ver::$(curl -s -H 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/taniman/profit-trailer/releases' | jq -r '.[0].tag_name') - + - name: Check if we already have this version id: local-check run: | echo ::set-output name=exists::$([ -z "`git tag -l | grep ^${{ steps.remote-check.outputs.remote_tag_ver }}$`" ] && echo "false" || echo "true") - + - name: Tag latest release version if: steps.local-check.outputs.exists == 'false' run: | @@ -48,7 +46,7 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Push the Docker images run: | docker push dodancs/profit-trailer:${{ steps.remote-check.outputs.remote_tag_ver }}