Skip to content

Commit 67b5826

Browse files
feat: publish and version slim and full images (#22)
* feat: usage and versioning with slim or full * docs: action
1 parent c5daf55 commit 67b5826

3 files changed

Lines changed: 32 additions & 16 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
name: Publish Docker image
1+
name: Publish Docker images
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
88
push_to_registry:
9-
name: Push Docker image to Docker Hub
9+
name: Push Docker images to Docker Hub
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
variant: [ slim, full ]
14+
env:
15+
IMAGE_NAME: junobuild/action
16+
VERSION: ${{ github.ref_name }}
17+
1118
steps:
1219
# Action: https://github.com/actions/checkout/releases/tag/v4.2.2
1320
- name: Check out the repo
@@ -20,22 +27,14 @@ jobs:
2027
username: ${{ secrets.DOCKER_USERNAME }}
2128
password: ${{ secrets.DOCKER_TOKEN }}
2229

23-
# Action: https://github.com/docker/metadata-action/releases/tag/v5.7.0
24-
- name: Extract metadata (tags, labels) for Docker
25-
id: meta
26-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
27-
with:
28-
images: junobuild/action
29-
tags: |
30-
type=semver,pattern={{major}}
31-
type=semver,pattern={{version}}
32-
3330
# Action: https://github.com/docker/build-push-action/releases/tag/v6.18.0
3431
- name: Build and push
3532
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
3633
with:
3734
context: .
38-
file: ./Dockerfile
35+
file: ${{ matrix.variant == 'full' && 'Dockerfile.full' || 'Dockerfile' }}
3936
push: true
40-
tags: ${{ steps.meta.outputs.tags }}
41-
labels: ${{ steps.meta.outputs.labels }}
37+
tags: |
38+
${{ env.IMAGE_NAME }}:${{ env.VERSION }}${{ matrix.variant == 'full' && '-full' || '' }}
39+
${{ env.IMAGE_NAME }}:${{ matrix.variant == 'slim' && 'slim' || 'full' }}
40+
${{ env.IMAGE_NAME }}:${{ matrix.variant == 'slim' && 'latest' || 'full' }}

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ jobs:
4343
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
4444
```
4545
46+
## Available Action Versions
47+
48+
You can choose from several action variants depending on your needs:
49+
50+
| Version tag | Description |
51+
|----------------------|---------------------------------------------------------------------|
52+
| `@main` or no tag | Defaults to the **slim** image |
53+
| `@slim` | Explicitly use the **slim** image |
54+
| `@full` | Use the **full** image |
55+
| `@vX.Y.Z` | Specific version tag for **slim** |
56+
| `@vX.Y.Z-slim` | Versioned **slim** image |
57+
| `@vX.Y.Z-full` | Versioned **full** image |
58+
59+
The **slim** image does not include the Rust toolchain or tools required to build serverless functions. It is smaller in size and suitable for most CLI use cases.
60+
61+
The **full** image includes the Rust toolchain and all necessary tools for building serverless functions, resulting in a larger image size.
62+
4663
## License
4764

4865
MIT © [David Dal Busco](mailto:david.dalbusco@outlook.com)

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ outputs:
1212

1313
runs:
1414
using: 'docker'
15-
image: 'docker://junobuild/action:0.2.0'
15+
image: 'docker://junobuild/action'

0 commit comments

Comments
 (0)