This repository contains a Dockerfile to create an image with the very nice tool github-release. With this tool you can upload respectively deploy any kind of artifacts to a release tag on GitHub.
- Image is based on official Alpine Linux based golang image
- Additional installed packages:
- git
You should prepare a directory on the host machine, which contains all files, which should be uploaded to GitHub. This directory will be mounted into the container.
Additionally you need a proper GitHub access token and put it into the environemt variable GITHUB_TOKEN:
export GITHUB_TOKEN=1234568790abcdef
To see a list of available commands and options you can run a container with this command:
docker run --rm -it spectreproject/github-uploader:latest github-release --help
For further details regarding usage of github-release please see it's own GitHub page.
To do an upload the usage schema is as follows:
docker run \
--rm \
-it \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
-v <folder-with-files-to-upload>:/filesToUpload \
spectreproject/github-deployer:latest \
github-release upload \
--user <GitHub-user-or-organization-name> \
--repo <GitHub-repo> \
--tag <tag-on-GitHub-repo> \
--name <name-of-file-after-upload> \
--file /filesToUpload/<file-to-upload>
All other commands of github-release can be used the same way.
Here's an example for the upload of the file aTest.txt, which will be available as notes.txt on the given tag latest:
docker run \
--rm \
-it \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
-v ~/filesToDeploy:/filesToUpload \
spectreproject/github-deployer:latest \
github-release upload \
--user HLXEasy \
--repo GitHub-Deployer \
--tag latest \
--name "notes.txt" \
--file /filesToUpload/aTest.txt
docker run \
--rm \ # Container will automatically be removed afterwards
-it \ # Start in interactive mode with a virtual terminal
-v <local-path>:/filesToUpload/ \ # Mapping of local data folder into the container
spectreproject/github-deployer:latest \ # Image to use
github-release ... # Executed command followed by all it's parameters
docker build -t spectreproject/github-uploader:latest .