Getting startedSection titled Getting started
Check out this quick guide. I recommend testing with a public repository as you go along with the guide. It’s very fast! ⚡️
BasicsSection titled Basics
- It’s a good idea to install this VSCode extension. At the very least, it can help lint the YAML files you write.
- You can test actions locally by using act, which essentially just uses the Docker API to do everything that GitHub would (but on your machine).
Manually running a workflowSection titled Manually running a workflow
- When authoring a workflow, consider using
workflow_dispatch, which lets you manually trigger the workflow rather than waiting for an event like a push (reference, YAML reference):
- Note that you don’t need the YML file to specify
contents: write; it’s your user that needs write permissions. So if you don’t have the “Run workflow” button after adding
workflow_dispatch, make sure you’re logged in as an admin of the repo.
Reference linksSection titled Reference links
- All Docker-related GitHub actions: https://docs.docker.com/build/ci/github-actions/
- Workflows that I’ve written for my bot
Finding a usable tag from an action in the marketplaceSection titled Finding a usable tag from an action in the marketplace
Suppose you’re on a page like this: https://github.com/docker/login-action. You may see a “View on Marketplace” button:
Clicking that will bring you to a page with a version selector at the upper right which you can use to see which tags are available:
Alternatively, you can just go to the Releases page and click “Tags” on it, which results in a URL like this: https://github.com/docker/login-action/tags
TroubleshootingSection titled Troubleshooting
Can’t build a Docker image through GitHub actionsSection titled Can’t build a Docker image through GitHub actions
If you can build locally, then perhaps you should try cloning the repo and trying to build in that fresh clone. It’s possible that a
COPY . . command doesn’t have the same source to copy from.