diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8003486..aaf69c3 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,14 +15,6 @@ jobs: steps: - name: Checkout image repo uses: actions/checkout@v3 - - name: Checkout upstream repo - uses: actions/checkout@v3 - with: - repository: mailhog/mailhog - token: ${{ secrets.GITHUB_TOKEN }} - path: upstream - # We're only interested in the tags, so check them out, too (not just a single commit) - fetch-depth: 0 - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -32,9 +24,8 @@ jobs: - name: Create tags id: create-tag run: | - # Find latest tag - cd upstream - VERSION="$(git describe --tags $(git rev-list --tags --max-count=1))" + # Find latest release (same as "go install github.com/mailhog/MailHog@latest" in Dockerfile) + VERSION="$( curl -s -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/mailhog/mailhog/releases/latest" | jq -r '.tag_name')" VERSION_DATE="$VERSION-$(date +'%Y-%m-%d')" GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/mailhog