Skip to content

Commit c8fa0f1

Browse files
committed
build: added a docker workflow
1 parent 00068cb commit c8fa0f1

File tree

2 files changed

+69
-3
lines changed

2 files changed

+69
-3
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1-
name: Release
1+
name: release
2+
23
env:
34
PACKAGE_NAME: "mcp-server-drupal"
45
TARGET_LIST: "x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-pc-windows-msvc,x86_64-apple-darwin,aarch64-apple-darwin"
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: omedia/mcp-server-drupal
8+
59
on:
610
push:
711
tags:
812
- "v*.*.*"
13+
914
permissions:
1015
contents: write
1116
id-token: write
17+
packages: write
18+
1219
jobs:
13-
build-and-sign:
20+
binary:
1421
runs-on: ubuntu-latest
1522
steps:
1623
- name: Checkout code
1724
uses: actions/checkout@v4
25+
1826
- name: Setup Deno
1927
uses: denoland/setup-deno@v2
2028
with:
2129
deno-version: "2.x"
30+
2231
- name: Extract version from tag
2332
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
33+
2434
- name: Setup cosign
2535
uses: sigstore/[email protected]
36+
2637
- name: Build the binaries
2738
run: |
2839
for target in $(echo $TARGET_LIST | tr "," "\n")
@@ -47,6 +58,7 @@ jobs:
4758
4859
deno task build --target=$target --output=./build/$binary_name
4960
done
61+
5062
- name: Sign binaries
5163
run: |
5264
mkdir -p build/bundles
@@ -60,9 +72,63 @@ jobs:
6072
cd build/bundles
6173
tar -czf ../signatures.tar.gz *
6274
cd ../..
75+
6376
- name: Release
6477
uses: softprops/action-gh-release@v2
6578
with:
6679
files: |
6780
build/*
6881
name: "MCP Server Drupal: ${{ env.VERSION }}"
82+
83+
docker:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@v4
88+
89+
- name: Extract version from tag
90+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
91+
92+
- name: Set up Docker Buildx
93+
uses: docker/setup-buildx-action@v3
94+
95+
- name: Login to GitHub Container Registry
96+
uses: docker/login-action@v3
97+
with:
98+
registry: ${{ env.REGISTRY }}
99+
username: ${{ github.actor }}
100+
password: ${{ secrets.GITHUB_TOKEN }}
101+
102+
- name: Extract metadata for Docker
103+
id: meta
104+
uses: docker/metadata-action@v5
105+
with:
106+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
107+
tags: |
108+
type=semver,pattern={{version}}
109+
type=raw,value=latest
110+
labels: |
111+
org.opencontainers.image.source=https://github.com/omedia/mcp-server-drupal
112+
org.opencontainers.image.description=MCP Server for Drupal
113+
org.opencontainers.image.licenses=MIT
114+
org.opencontainers.image.version=${{ env.VERSION }}
115+
org.opencontainers.image.created={{date 'iso8601'}}
116+
117+
- name: Build and push Docker image
118+
uses: docker/build-push-action@v5
119+
with:
120+
context: .
121+
push: true
122+
tags: ${{ steps.meta.outputs.tags }}
123+
labels: ${{ steps.meta.outputs.labels }}
124+
cache-from: type=gha
125+
cache-to: type=gha,mode=max
126+
platforms: linux/amd64,linux/arm64
127+
128+
- name: Sign the images with Cosign
129+
uses: sigstore/[email protected]
130+
131+
- name: Sign container image
132+
run: |
133+
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
134+
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@omedia/mcp-server-drupal",
3-
"version": "1.0.0-alpha5",
3+
"version": "1.0.0",
44
"license": "MIT",
55
"exports": "./src/mod.ts",
66
"tasks": {

0 commit comments

Comments
 (0)