diff --git a/.github/workflows/on-push-server.yaml b/.github/workflows/on-push-server.yaml deleted file mode 100644 index 1d740cf1..00000000 --- a/.github/workflows/on-push-server.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: On Push Server -on: - push: {branches: [server]} -jobs: - push-docker-image: - runs-on: ubuntu-latest - env: - DOCKER_CLI_EXPERIMENTAL: enabled - steps: - - uses: actions/checkout@v4 - - name: metadata - id: metadata - run: | - git fetch --all --tags - TAG=$(git describe --tags) - echo "tag=${TAG/-*}" >> $GITHUB_OUTPUT - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - with: - install: true - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build & push prem - run: >- - docker buildx build --push - --file Dockerfile - --tag ghcr.io/premai-io/prem-app:latest - --tag ghcr.io/premai-io/prem-app:${{ steps.metadata.outputs.tag }} - --platform linux/arm64,linux/amd64 . diff --git a/.github/workflows/on-workflow-dispatch-docker.yaml b/.github/workflows/on-workflow-dispatch-docker.yaml new file mode 100644 index 00000000..099e0014 --- /dev/null +++ b/.github/workflows/on-workflow-dispatch-docker.yaml @@ -0,0 +1,51 @@ +name: 🚀 Docker Image + +on: + workflow_dispatch: + inputs: + version: + description: 'Version tag for the Docker image (optional, will use latest Git tag if empty)' + required: false + type: string + tag_as_latest: + description: 'Also tag as latest?' + required: false + default: false + type: boolean + +jobs: + push-docker-image: + runs-on: ubuntu-latest + env: + DOCKER_CLI_EXPERIMENTAL: enabled + steps: + - uses: actions/checkout@v4 + - name: Determine tag + id: tag + run: | + if [ -z "${{ github.event.inputs.version }}" ]; then + git fetch --all --tags + TAG=$(git describe --tags `git rev-list --tags --max-count=1`) + else + TAG=${{ github.event.inputs.version }} + fi + echo "VERSION_TAG=$TAG" >> $GITHUB_ENV + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + with: + install: true + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build & push + run: | + TAGS="ghcr.io/premai-io/prem-app:$VERSION_TAG" + if ${{ github.event.inputs.tag_as_latest }} == 'true'; then + TAGS="$TAGS,ghcr.io/premai-io/prem-app:latest" + fi + docker buildx build --push \ + --file Dockerfile \ + --tag $TAGS \ + --platform linux/arm64,linux/amd64 . diff --git a/.github/workflows/on-release.yaml b/.github/workflows/on-workflow-dispatch-tauri.yaml similarity index 91% rename from .github/workflows/on-release.yaml rename to .github/workflows/on-workflow-dispatch-tauri.yaml index 0b5705a6..91cd07aa 100644 --- a/.github/workflows/on-release.yaml +++ b/.github/workflows/on-workflow-dispatch-tauri.yaml @@ -1,14 +1,19 @@ -name: Release on user input +name: 🚀 Tauri Dekstop App on: workflow_dispatch: inputs: branchName: - description: 'Branch Name' + description: 'Branch Name you are releasing from' required: true version: - description: 'New version' + description: 'Version tag for the Github Release and the .dmg for MacOS' required: true + release_as_draft: + description: 'Release as Draft' + required: false + default: true + type: boolean jobs: publish-tauri: @@ -110,7 +115,7 @@ jobs: tagName: ${{ github.event.inputs.version }} releaseName: "PremAI App ${{ github.event.inputs.version }}" releaseBody: "See the assets to download and install this version." - releaseDraft: false + releaseDraft: ${{ github.event.inputs.release_as_draft }} includeDebug: true updaterJsonKeepUniversal: true args: ${{matrix.platform == 'ubuntu-20.04' && '--target x86_64-unknown-linux-gnu' || '--target universal-apple-darwin'}}