-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jveldboom/create-release-process
feat: add release workflow
- Loading branch information
Showing
2 changed files
with
68 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get next version | ||
uses: jveldboom/action-conventional-versioning@v1 | ||
id: version | ||
|
||
- name: Log in to the container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build & push image | ||
run: | | ||
docker build . \ | ||
--tag ghcr.io/${GITHUB_REPOSITORY}:${{ steps.version.outputs.version }} \ | ||
--tag ghcr.io/${GITHUB_REPOSITORY}:latest | ||
docker push --all-tags ghcr.io/${GITHUB_REPOSITORY} | ||
- name: Create GitHub Release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh release create "${{ steps.version.outputs.version }}" \ | ||
--generate-notes \ | ||
--target "${{ github.sha }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
# Docker Google's Guetzli | ||
Run Google's Guetzli within Docker. | ||
# Docker Google's Guetzli | ||
Run Google's Guetzli within Docker. | ||
|
||
Visit https://github.com/google/guetzli for Guetzli's full documentation | ||
|
||
# Run | ||
- `docker run --rm -v $(PWD):/tmp jveldboom/google-guetzli input.jpg output.jpg` | ||
## Usage | ||
```sh | ||
docker run --rm -v $(PWD):/tmp jveldboom/google-guetzli input.jpg output.jpg | ||
``` | ||
|
||
# Run Examples | ||
- `docker run --rm -v $(PWD):/tmp jveldboom/google-guetzli --quality 85 ./samples/bees.png ./samples/bees-out.png` | ||
## Run Examples | ||
```sh | ||
docker run --rm -v $(PWD):/tmp jveldboom/google-guetzli --quality 85 ./samples/bees.png ./samples/bees-out.png | ||
``` | ||
|
||
Original | Processed with 85% | ||
:------------: | :-------------: | ||
![Original](./samples/bees.png)<br>177 KB | ![Original](./samples/bees-out.png)<br> 22 KB | ||
![Original](./samples/rose.jpg)<br>219 KB | ![Original](./samples/rose-out.png)<br> 103 KB | ||
|
||
# TODO | ||
- <strike>Reduce container image size. Likely do not need full Ubuntu image</strike> | ||
- <strike>Add to Docker Hub for easier installation</strike> | ||
## TODO | ||
- [ ] create pull request workflow | ||
- [ ] include dockerignore to reduce image size | ||
- [ ] see if we can reduce overall container size | ||
|
||
```sh | ||
# dockerfile | ||
apk add --no-cache --virtual .build-deps | ||
|
||
... | ||
|
||
apk del --no-cache .build-deps | ||
rm -rf /var/tmp/* /tmp/* /opt/build | ||
``` |