Skip to content

Commit

Permalink
Add GitHub action for docker generation and publish to Github Packages (
Browse files Browse the repository at this point in the history
#16)

* Test package action for github packages
* Update package name
* Add latest tag for newest docker build
* Update readme to point to github packages instead of docker hub
  • Loading branch information
scosman authored Nov 3, 2022
1 parent 205eb44 commit fc1916c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to Docker
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Build container
uses: docker/build-push-action@v1
with:
username: scosman
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: scosman/packages/zipstreamer
tags: latest
tag_with_sha: true
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Cloud Run is ideal for zipstreamer, as it routes many requests to a single conta

### Docker

This repo contains an dockerfile, and an image is hosted [on Docker Hub](https://hub.docker.com/r/scosman/zipstreamer).
This repo contains an dockerfile, and an image is published [on Github Packages](https://github.com/scosman/zipstreamer/pkgs/container/packages%2Fzipstreamer).

#### Build Your Own Image

Expand All @@ -88,12 +88,14 @@ docker build --tag docker-zipstreamer .
docker run --env PORT=8080 -p 8080:8080 docker-zipstreamer
```

#### Run Docker Hub Image
#### Run Offical Package from Github Packages

Currently every change to master it published as a package. To use these offical packages:

```
docker pull scosman/zipstreamer
docker pull ghcr.io/scosman/packages/zipstreamer:latest
# Start on port 8080
docker run --env PORT=8080 -p 8080:8080 scosman/zipstreamer
docker run --env PORT=8080 -p 8080:8080 ghcr.io/scosman/packages/zipstreamer:latest
```

## Config
Expand Down

0 comments on commit fc1916c

Please sign in to comment.