Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

fix github action to build and push server docker container on release. use dockerhub for container hosting

Dane Schneider1acbd90840f9
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index f806b088..4eca04cf 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -3,22 +3,42 @@ name: Build and publish Docker Image if a new Github release was created
on:
release:
types: [created]
+ workflow_dispatch: # enable manual triggering
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
+ # old output approach
+ # - name: Check if the release tag starts with 'server'
+ # id: check_tag
+ # run: |
+ # if [[ ! "${GITHUB_REF_NAME}" =~ ^server ]]; then
+ # echo "::set-output name=skip::true"
+ # else
+ # echo "::set-output name=skip::false"
+ # fi
+ # shell: bash
+
+ # use new $GITHUB_OUTPUT approach
- name: Check if the release tag starts with 'server'
id: check_tag
run: |
if [[ ! "${GITHUB_REF_NAME}" =~ ^server ]]; then
- echo "::set-output name=skip::true"
+ echo "skip=true" >> $GITHUB_OUTPUT
else
- echo "::set-output name=skip::false"
+ echo "skip=false" >> $GITHUB_OUTPUT
fi
shell: bash
+ # for local testing with act
+ # - name: Check if the release tag starts with 'server'
+ # id: check_tag
+ # run: |
+ # echo "skip=false" >> $GITHUB_OUTPUT
+ # shell: bash
+
- name: Skip build if tag does not start with 'server'
if: steps.check_tag.outputs.skip == 'true'
run: echo "Skipping build because the tag does not start with 'server'."
@@ -31,27 +51,25 @@ jobs:
if: steps.check_tag.outputs.skip == 'false'
uses: docker/setup-buildx-action@v1
- - name: Log in to GitHub Container Registry
+ - name: Log in to Docker Hub
if: steps.check_tag.outputs.skip == 'false'
uses: docker/login-action@v1
with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Sanitize ref name
id: sanitize
if: steps.check_tag.outputs.skip == 'false'
- run: echo "SANITIZED_REF_NAME=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
+ run: echo "SANITIZED_REF_NAME=$(echo $GITHUB_REF_NAME | tr '/' '-')" >> $GITHUB_OUTPUT
- name: Build and push
if: steps.check_tag.outputs.skip == 'false'
uses: docker/build-push-action@v2
with:
context: ./app/
- file: ./app/Dockerfile.server
- push: true
+ file: ./app/server/Dockerfile
+ push: false
tags: |
- ghcr.io/${{ github.repository_owner }}/plandex-server:${{ env.SANITIZED_REF_NAME }}
- ghcr.io/${{ github.repository_owner }}/plandex-server:latest
+ plandexai/plandex-server:${{ steps.sanitize.outputs.SANITIZED_REF_NAME }}
+ plandexai/plandex-server:latest
diff --git a/.gitignore b/.gitignore
index 6764afc8..9a42dbd4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,8 @@
.plandex-v2/
.plandex-dev-v2/
.envkey
+.env
+.env.*
plandex
plandex-dev
plandex-server