Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Pushing an existing Docker image #9

Description

@Happy-Ferret

Curious. How would I go about pushing an image I've already built through the Docker CLI, in a previous build step?

My current workflow looks as follows:

    steps:
    - uses: actions/checkout@v1
    - name: Sign into Docker registry
      run: |
        docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
      env:
        DOCKER_USERNAME: ${{ secrets.DOCKER_USER }}
        DOCKER_PASSWORD: ${{ secrets.DOCKER_PW }}
        DOCKER_REGISTRY_URL: docker.pkg.github.com
    - name: Remove old Docker image
      run: |
        docker images -a 
        docker rmi --force 'latest'
    - name: Build Docker image
      run: | 
        cd WebApplication1Core
        docker images -a 
        docker build -t docker.pkg.github.com/ebsone/ci-test-mr/webapplication1corenew:latest -f WebApplication1Core/Dockerfile .
    - name: Push Docker image
      env:
        DOCKER_USERNAME: ${{ secrets.DOCKER_USER }}
        DOCKER_PASSWORD: ${{ secrets.DOCKER_PW }}
        DOCKER_REGISTRY_URL: docker.pkg.github.com
      run: |
        docker push docker.pkg.github.com/ebsone/ci-test-mr/webapplication1corenew:latest
    - name: Heroku Login
      uses: actions/heroku@master
      env:
        HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
      with:
        args: container:login
    - name: Heroku Tag
      run: |
        docker tag docker.pkg.github.com/ebsone/ci-test-mr/webapplication1corenew:latest registry.heroku.com/ci-test-mr/web
      env:
        HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
    - name: Heroku Push
      uses: actions/heroku@master
      env:
        HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
      with:
        args: container:push -a ci-test-mr registry.heroku.com/ci-test-mr/web
    - name: Heroku Release
      uses: actions/heroku@master
      env:
        HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
      with:
        args: container:release -a ci-test-mr registry.heroku.com/ci-test-mr/web

This fails during the "Heroku Push" step.

Error message: No images to push

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions