Skip to content

Commit

Permalink
Publishing deco-cx daemon image (#789)
Browse files Browse the repository at this point in the history
* Publishing deco-cx daemon image

Signed-off-by: Marcos Candeia <[email protected]>

* Change to alpha.1 tag

Signed-off-by: Marcos Candeia <[email protected]>

* Add contents write

Signed-off-by: Marcos Candeia <[email protected]>

* Add contents write

Signed-off-by: Marcos Candeia <[email protected]>

* Fix token access

Signed-off-by: Marcos Candeia <[email protected]>

---------

Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia authored Aug 21, 2024
1 parent 14b2086 commit 2f66cda
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
56 changes: 55 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
Expand All @@ -19,4 +21,56 @@ jobs:
run: npx jsr publish --allow-slow-types

- name: Publish script package
run: cd scripts/ && npx jsr publish
run: cd scripts/ && npx jsr publish

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Create a new builder instance
run: docker buildx create --name mybuilder --use

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build, tag, and push the builder image to Github ghcr
id: build-builder-image
env:
REGISTRY: ghcr.io
REPOSITORY: deco-cx/deco
IMAGE_TAG_LATEST: latest
IMAGE_TAG_COMMIT: ${{ github.ref_name }}
run: |
# Get the current tag
# Create the Dockerfile
cat <<EOF > Dockerfile
FROM denoland/deno:alpine-1.44.4
# The port that your application listens to.
EXPOSE 8000
WORKDIR /app
# maybe add deno lsp?
RUN apk add git openssh
RUN deno cache jsr:@deco/deco@$IMAGE_TAG_COMMIT/scripts/run
RUN mkdir -p /home/deno && chown -R deno:deno /home/deno && mkdir /app/deco && chown -R deno:deno /app && mkdir -p /deno-dir && chown -R deno:deno /deno-dir
# Prefer not to run as root.
USER deno
WORKDIR /app/deco
EOF
docker buildx build --platform linux/amd64,linux/arm64 -t $REGISTRY/$REPOSITORY:$IMAGE_TAG_LATEST -t $REGISTRY/$REPOSITORY:$IMAGE_TAG_COMMIT --push .
echo "::set-output name=image_builder_latest::$REGISTRY/$REPOSITORY:$IMAGE_TAG_LATEST"
echo "::set-output name=image_builder_commit::$REGISTRY/$REPOSITORY:$IMAGE_TAG_COMMIT"
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deco/deco",
"version": "1.89.8",
"version": "1.89.9-alpha.1",
"exports": {
".": "./mod.ts",
"./htmx": "./runtime/htmx/mod.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deco/scripts",
"version": "1.89.8",
"version": "1.89.9-alpha.1",
"exports": {
"./release": "./release.ts",
"./update": "./update.run.ts",
Expand Down

0 comments on commit 2f66cda

Please sign in to comment.