1

Coming from this issue

I am using GitHub Actions for Gradle project with this given steps:

name: Java CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - name: Set up JDK 13
        uses: actions/setup-java@v1
        with:
          java-version: 13

      - run: ./gradlew bootJar

      - name: Login to Github regestry
        run: docker login docker.pkg.github.com -u xxxxx -p xxxxx

      - name: Build the Docker image
        run: docker build . -t docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.$GITHUB_REF


      - name: Push the image to github
        run: docker push docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.$GITHUB_REF


At the last step I get this error:

The push refers to repository [docker.pkg.github.com/sulimanlab/realtime-chat/realtimechat-snapshot-0.refs/heads/master]

3aad04996f8f: Preparing

77cae8ab23bf: Preparing

error parsing HTTP 404 response body: invalid character 'p' after top-level value: "404 page not found\n"

suliman
  • 334
  • 6
  • 17
  • This seems like an issue with docker, not github actions. See this [issue](https://github.com/docker/hub-feedback/issues/1697) – smac89 Nov 19 '19 at 16:22
  • I solved it actually, many thanks man https://stackoverflow.com/a/58938666/10420300 – suliman Nov 19 '19 at 16:25
  • Nice one. I was just about to post something I read about [github packages](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-docker-for-use-with-github-packages#publishing-a-package). It says the way to push is to use the syntax `docker push docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION`, then below that it says, _**Note**: You must push your image using `IMAGE_NAME:VERSION` and not using `IMAGE_NAME:SHA`_. If this works for you, I guess it works then which is good – smac89 Nov 19 '19 at 16:27

1 Answers1

1

actually I was using the wrong environment variable to tag my images.

I used $GITHUB_REF what I should use $GITHUB_SHA

suliman
  • 334
  • 6
  • 17