Skip to content

Commit

Permalink
CI: Build container with version information derived from tag
Browse files Browse the repository at this point in the history
Signed-off-by: Heathcliff <[email protected]>
  • Loading branch information
heathcliff26 committed Jul 14, 2024
1 parent 256dd05 commit 3252384
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ name: CI

on:
workflow_dispatch:
inputs:
tag:
description: "Use to set tag, default: rolling"
type: string
default: "rolling"
required: false
dry-run:
description: "Do not push image"
type: boolean
default: false
required: false
latest:
description: "Tag latest"
type: boolean
default: false
required: false
push:
branches: ["main"]
paths:
Expand Down Expand Up @@ -33,6 +49,8 @@ jobs:
packages: write
with:
dockerfile: Dockerfile
tag: latest
dry-run: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
tag: "${{ inputs.tag == '' && 'rolling' || inputs.tag }}"
tags: "${{ inputs.latest == true && 'type=raw,value=latest' || '' }}"
dry-run: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' || inputs.dry-run == 'true' }}
build-args: "RELEASE_VERSION=${{ inputs.tag == '' && 'rolling' || inputs.tag }}"
secrets: inherit
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ $ podman run -d -p 8080:8080 -v /path/to/content:/webroot ghcr.io/heathcliff26/s

### Image location

| Container Registry | Image |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| Container Registry | Image |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------ |
| [Github Container](https://github.com/users/heathcliff26/packages/container/package/simple-fileserver) | `ghcr.io/heathcliff26/simple-fileserver` |
| [Docker Hub](https://hub.docker.com/repository/docker/heathcliff26/simple-fileserver) | `docker.io/heathcliff26/simple-fileserver` |

### Tags

There are different flavors of the image:

| Tag(s) | Describtion |
| ----------- | ----------------------------------------------------------- |
| **latest** | Last released version of the image |
| **rolling** | Rolling update of the image, always build from main branch. |
| **vX.Y.Z** | Released version of the image |

0 comments on commit 3252384

Please sign in to comment.