1- name : Build and Push Docker Image
1+ name : Build and Push Docker Images
22
33on :
44 push :
77 workflow_dispatch :
88
99jobs :
10- build-and-push :
11- name : Build and Push Docker Image
10+ build-and-push-bun :
11+ name : Build and Push Bun Image
1212 runs-on : ubuntu-latest
1313 permissions :
1414 contents : write
2727 username : ${{ github.repository_owner }}
2828 password : ${{ github.token }}
2929
30- - name : Extract Docker metadata
31- id : meta
30+ - name : Extract Docker metadata (Bun)
31+ id : meta-bun
3232 uses : docker/metadata-action@v5
3333 with :
3434 images : ghcr.io/dcodesdev/letterspace
@@ -39,16 +39,67 @@ jobs:
3939 type=semver,pattern={{major}}
4040 type=raw,value=latest,enable=${{ !contains(github.ref, '-') }}
4141
42- - name : Build and push Docker image
42+ - name : Build and push Docker image (Bun)
4343 uses : docker/build-push-action@v6
4444 with :
4545 context : .
4646 push : true
47- tags : ${{ steps.meta.outputs.tags }}
47+ tags : ${{ steps.meta-bun .outputs.tags }}
4848 # platforms: linux/amd64,linux/arm64
49- cache-from : type=gha
50- cache-to : type=gha,mode=max
49+ cache-from : type=gha,scope=bun
50+ cache-to : type=gha,mode=max,scope=bun
5151
52+ build-and-push-node :
53+ name : Build and Push Node Image
54+ runs-on : ubuntu-latest
55+ permissions :
56+ contents : write
57+ packages : write
58+
59+ steps :
60+ - uses : actions/checkout@v4
61+
62+ - name : Set up Docker Buildx
63+ uses : docker/setup-buildx-action@v3
64+
65+ - name : Login to GitHub Container Registry
66+ uses : docker/login-action@v3
67+ with :
68+ registry : ghcr.io
69+ username : ${{ github.repository_owner }}
70+ password : ${{ github.token }}
71+
72+ - name : Extract Docker metadata (Node)
73+ id : meta-node
74+ uses : docker/metadata-action@v5
75+ with :
76+ images : ghcr.io/dcodesdev/letterspace
77+ tags : |
78+ type=ref,event=tag
79+ type=semver,pattern={{version}}-node
80+ type=semver,pattern={{major}}.{{minor}}-node
81+ type=semver,pattern={{major}}-node
82+ type=raw,value=latest-node,enable=${{ !contains(github.ref, '-') }}
83+
84+ - name : Build and push Docker image (Node)
85+ uses : docker/build-push-action@v6
86+ with :
87+ context : .
88+ file : ./Dockerfile.node
89+ push : true
90+ tags : ${{ steps.meta-node.outputs.tags }}
91+ # platforms: linux/amd64,linux/arm64
92+ cache-from : type=gha,scope=node
93+ cache-to : type=gha,mode=max,scope=node
94+
95+ release :
96+ name : Create GitHub Release
97+ runs-on : ubuntu-latest
98+ permissions :
99+ contents : write
100+ needs : [build-and-push-bun, build-and-push-node]
101+ steps :
102+ - uses : actions/checkout@v4
52103 - name : Release
53104 uses : softprops/action-gh-release@v2
54105 with :
0 commit comments