summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/publish.yml7
-rwxr-xr-xpackages/opencode/script/publish.ts6
2 files changed, 13 insertions, 0 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index a339c7dab..710d7c0a1 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -61,6 +61,13 @@ jobs:
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
- name: Publish
run: |
./script/publish.ts
diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts
index ccf7e5cbb..70d18905e 100755
--- a/packages/opencode/script/publish.ts
+++ b/packages/opencode/script/publish.ts
@@ -245,4 +245,10 @@ if (!Script.preview) {
await $`cd ./dist/homebrew-tap && git add opencode.rb`
await $`cd ./dist/homebrew-tap && git commit -m "Update to v${Script.version}"`
await $`cd ./dist/homebrew-tap && git push`
+
+ const image = "ghcr.io/sst/opencode"
+ await $`docker build -t ${image}:${Script.version} .`
+ await $`docker push ${image}:${Script.version}`
+ await $`docker tag ${image}:${Script.version} ${image}:latest`
+ await $`docker push ${image}:latest`
}