Giter Club home page Giter Club logo

github-actions-publish-to-github-packages's Issues

Course name

On the outline, we named this a course on:

Artifacts and GPR

I think this is still the case. The course the follows it is on "CD". What if we change the name to something like:

Publish a Docker container to the GitHub Package Registry

Wrong version of Docker Action used - fails Actions run

Describe the bug
A clear and concise description of what the bug is.

The docker action specified in this file:

https://github.com/githubtraining/github-actions-publish-to-github-packages/blob/main/responses/01.1_Docker-Workflow.md

Is @v1, which is not supported and will cause the job to fail. @v2 should be utilized instead.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

GPR no longer a home for Docker images

Describe the bug
Docker image support in GPR is deprecated in favor of using GCR for Docker images. This course will begin to break soon if we don't address this change.

generate repository with lower case

Describe the bug
I was just taking this course and noticed that because my github name has uppercase characters in it, the code generated by the bot was this:

Build-and-Push-Docker-Image:
    runs-on: ubuntu-latest
    needs: test
    name: Docker Build, Tag, Push

    steps:
    - name: Checkout
      uses: actions/checkout@v1
    - name: Download built artifact
      uses: actions/download-artifact@main
      with:
        name: webpack artifacts
        path: public
    - name: Build container image
      uses: docker/build-push-action@v1
      with:
        username: ${{github.actor}}
        password: ${{secrets.GITHUB_TOKEN}}
        registry: docker.pkg.github.com
        repository: Elias-Vandewalle/github-actions-for-packages/tic-tac-toe
        tag_with_sha: true

The problem is that docker doesn't accept uppercase in the 'repository' input. This exercise could be completed by changing the repository to elias-vandewalle/github-actions-for-packages/tic-tac-toe.

To Reproduce
Steps to reproduce the behavior:

  1. Have an uppercase character in your username
  2. Start the exercise
  3. Rename the file, get to the step where you change the contents & name of ci-workflow.yml
  4. Docker Build, Tag, Push will fail if there is an uppercase character in the repository

Screenshots
image

Expected behavior
generate repository in lowercase

Use Docker-built action for publishing to Packages

Is your feature request related to a problem? Please describe.
No problems / bugs at the moment.

Describe the solution you'd like
We should begin using the Docker-built action for publishing images to GitHub Packages. Currently, we're using mattdavis0351/actions/docker-gpr which is โœจ. However, longer term it'd make sense to use docker/build-push-action so that we can rely on Docker's maintenance cadence.

Describe alternatives you've considered
We can continue using the existing action with little risk.

Additional context
This was suggested by @decyjphr ๐Ÿ™‡โ€โ™‚๏ธ. Courtesy pings for @ppremk and @mattdavis0351.

Bug on the cd-workflow

Describe the bug
On the Step 2, when you have to build and publish the Docker Image to Docker Package, the config is not true.

I have some problems:

  • First the bot use Bigaston/... as package name (on the response), and Docker not accept uppercase so maybe it can be cool to lowercase the package name?
  • Then, when I cant to publish, I've firstly an error and I see a warning so I pass the build-push-action to version 2 but at this moment the build doesn't Work
  • I've to read the documentation on github and on the build-push-action repo to find what is the correct config. I've use this finaly
  Build-and-Push-Docker-Image:
    runs-on: ubuntu-latest
    needs: build
    name: Docker Build, Tag, Push

    steps:
    - name: Checkout
      uses: actions/checkout@v1
    - name: Download built artifact
      uses: actions/download-artifact@main
      with:
        name: webpack artifacts
        path: public
    - name: Log in to the Container registry
      uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
      with:
        registry: ghcr.io
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    - name: Extract metadata (tags, labels) for Docker
      id: meta
      uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
      with:
        images: ghcr.io/${{ github.repository }}
    - name: Build container image
      uses: docker/build-push-action@v2
      with:
        context: .
        push: true
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}

To Reproduce

Expected behavior

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context
I don't really know how to update the course so I just want to report the problem here ^^' But thanks for the lesson, it's very intresting!

Publishing action seems to succeed when it should fail

I've seen two cases where the push to the Packages failed but the Action we're using succeeded:

  1. @pierluigi reported an issue where the Action should've reported a problem but still succeeded:

    unauthorized: This operation would exceed the storage allotment for this account.

  2. I had a package that wasn't uniquely named, so the action didn't succeed but it still reported successful:

    blob upload invalid: Package "tic-tac-toe" is already associated with another repository.

In both of these cases, the course completed because of the reported success from the action, but should have actually failed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.