-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a publish workflow and edit the README file
- Loading branch information
1 parent
3094d60
commit df6c2c1
Showing
3 changed files
with
64 additions
and
1 deletion.
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,43 @@ | ||
name: Publish container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Aquire code | ||
if: always() | ||
uses: actions/checkout@v2 | ||
- name: Log into ghcr.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
ghcr.io/mini-bomba/create-github-release | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{raw}} | ||
type=sha,prefix=,suffix=,format=short | ||
- name: Build & push image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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 |
---|---|---|
|
@@ -73,7 +73,7 @@ jobs: | |
# would go here | ||
# | ||
- name: Release the new binaries | ||
uses: mini-bomba/create-github-release@v1.0.0 | ||
uses: mini-bomba/create-github-release@v1.1.0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: "latest" | ||
|
@@ -89,4 +89,23 @@ jobs: | |
build/*.exe | ||
clear_attachments: true | ||
``` | ||
## Using the ghcr.io image instead of building on demand | ||
I provide automatically-built docker images via Gihub Packages, which are compatible with any workflows using the action. | ||
If my action takes too long to build on demand for you, or if you have issues with multiple copies cluttering up your | ||
selfhosted runner's disk space, you can use the prebuilt images instead. | ||
To replace the action with the prebuilt image, simply replace | ||
```yaml | ||
uses: mini-bomba/[email protected] | ||
``` | ||
with | ||
```yaml | ||
uses: docker://ghcr.io/mini-bomba/[email protected] | ||
``` | ||
in your workflows. | ||
The images are built for any version tag and any commit on the main branch. | ||
Note that commit images are tagged with the first 7 characters of the commit hash. | ||
See the package page for more info. | ||
The images should work in the same way as the action, no further changes to the workflow should be required. |