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

add cacheTag suport #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This action requires three input parameters:
The action also accepts some optional input parameters:

* `githubToken`: Your GitHub token, used for caching Docker images in your project's public package registry. Usually this would just be `${{ github.token }}`. This speeds up subsequent builds and is highly recommended.
* `cacheTag`: An arbitrary string, used to qualify the Docker images cached. Useful if you are building different images for the same `arch`/`distro`.
* `env`: Environment variables to propagate to the container. YAML, but must begin with a `|` character. These variables will be available in both run and setup.
* `shell`: The shell to run commands with in the container. Default: `/bin/sh` on Alpine, `/bin/bash` for other distros.
* `dockerRunArgs`: Additional arguments to pass to `docker run`, such as volume mappings. See [`docker run` documentation](https://docs.docker.com/engine/reference/commandline/run).
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: 'Your GitHub token, used for caching Docker images in your project''s public package registry. Usually this would just be $\{{ github.token }}. This speeds up builds and is highly recommended.'
required: true
default: ''
cacheTag:
description: 'An arbitrary string, used to qualify the Docker images cached. Useful if you are building different images for the same arch/distro.'
required: false
default: ''
env:
description: 'Environment variables to propagate to the container. YAML, but must begin with a | character. These variables will be available in both run and setup.'
required: false
Expand Down
7 changes: 6 additions & 1 deletion src/run-on-arch.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ async function main() {
});
}

let cacheTag = core.getInput('cacheTag');
if (!cacheTag) {
cacheTag = 'default'
}

// Generate a container name slug unique to this workflow
const containerName = slug([
'run-on-arch', env.GITHUB_REPOSITORY, env.GITHUB_WORKFLOW,
arch, distro,
arch, distro, cacheTag,
].join('-'));

console.log('Configuring Docker for multi-architecture support')
Expand Down