Skip to content

Commit

Permalink
ops(feat): deploy to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonraimondi committed Nov 17, 2023
1 parent 4d9d2d0 commit d3d068d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Publish Docker Image

on:
push:
branches:
- main
tags:
- '*'

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get tag version
id: prep
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
echo "::set-output name=version::latest"
else
echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
fi
- uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/url-to-png:${{ steps.prep.outputs.version }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A URL to PNG generator over HTTP with a fairly simple API accessed via query par
Run the following command:

```
docker run --rm -p 3000:3000 jasonraimondi/url-to-png
docker run --rm -p 3000:3000 ghcr.io/jasonraimondi/url-to-png
```

On the hub: [Link to DockerHub](https://hub.docker.com/r/jasonraimondi/url-to-png/)
Expand Down

0 comments on commit d3d068d

Please sign in to comment.