Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running @branch may not pull the :branch image #32

Closed
4 tasks done
solvaholic opened this issue Jan 1, 2021 · 3 comments
Closed
4 tasks done

Running @branch may not pull the :branch image #32

solvaholic opened this issue Jan 1, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@solvaholic
Copy link
Owner

solvaholic commented Jan 1, 2021

What I did

  1. Pushed changes to solvaholic/octodns-sync:branchX
  2. Configured workflow in a different repo to run solvaholic/octodns-sync@branchX.

What I expected to happen

octodns-sync pulled the :branchX Docker image and used that.

What happened instead

octodns-sync pulled the :latest Docker image and used that.

This happened because I did not modify action.yml in branchX to pull the desired image.

Additional info

I'd like to:

  • On every push to main or a version tag, build and push container with version :${{ github.sha }}
  • When build-push-test is run manually, build and push container with version :${{ github.sha }}
  • When run for a branch, or a version tag, push corresponding image tags/versions
  • [ ] Clarify in doc: Using @branchX in a workflow will pull the Docker image named in that branch's action.yml
  • [ ] Provide instructions to modify action.yml when user would like to test changes, using a workflow
  • Update release checklist as needed
  • [ ] When a branch is deleted, automatically remove its corresponding Docker image tags
  • [ ] Automatically remove SHA-based image tags after some number of days

When everything is checked ☝️ this is considered done.


For posterity: Over in solvaholic/scaling-succotash I tried having a composite Action pull and run the Docker container (rather than use a docker Action). That way I was able to docker run an arbitrary tag, using version :${{ github.sha }}.

This worked, inasmuch as it ran the container's entrypoint. But I did not see a straightforward way to get the user's environment variables into the running container where octodns-sync could use them.

https://github.com/solvaholic/scaling-succotash/blob/8a3a17433113065bf7b13cc10f40c4e51848534c/action.yml

@solvaholic solvaholic added the bug Something isn't working label Jan 1, 2021
@solvaholic solvaholic self-assigned this Jan 1, 2021
@solvaholic
Copy link
Owner Author

  • On every push to main or a version tag, build and push container with version :${{ github.sha }}
  • When build-push-test is run manually, build and push container with version :${{ github.sha }}
  • When run for a branch, or a version tag, push corresponding image tags/versions

I tested changes for these over in:

https://github.com/solvaholic/scaling-succotash/blob/4b0d9694f62ef2091844123621f226d28e882547/.github/workflows/docker.yml

solvaholic added a commit that referenced this issue Jan 1, 2021
@solvaholic
Copy link
Owner Author

  • Clarify in doc: Using @branchX in a workflow will pull the Docker image named in that branch's action.yml
  • Provide instructions to modify action.yml when user would like to test changes, using a workflow

These two I'll skip for now, since only one user can make branches in this repo. When I come back to it I'll document how to test changes to the Action using a fork.

  • When a branch is deleted, automatically remove its corresponding Docker image tags
  • Automatically remove SHA-based image tags after some number of days

Currently, that I can see, GitHub's APIs do not provide the ability to programmatically delete a published container.

@solvaholic
Copy link
Owner Author

I guess this issue isn't solved really. I've done all I plan to do with it just now, though, so I'll close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant