diff --git a/.github/workflows/deploy_to_windmill.yml b/.github/workflows/deploy_to_windmill.yml index 215986d64e..a7b925e263 100644 --- a/.github/workflows/deploy_to_windmill.yml +++ b/.github/workflows/deploy_to_windmill.yml @@ -3,6 +3,8 @@ name: Deploy to windmill.dev on: push: branches: [main] + paths: + - "community/*" jobs: deploy: diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3ce60d83a8..2fec16635f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,7 +1,13 @@ -name: Docker Image CI +env: + LOCAL_REGISTRY: registry.wimill.xyz + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +name: Build and push docker image on: push: branches: [main] + tags: ["*"] pull_request: types: [opened, synchronize, reopened] @@ -12,28 +18,51 @@ concurrency: jobs: build: runs-on: [self-hosted, new] - env: - DOCKER_BUILDKIT: 1 steps: - - name: Wait for release to succeed - if: github.ref == 'refs/heads/main' - uses: lewagon/wait-on-check-action@v1.0.0 - with: - ref: ${{ github.ref }} - check-name: "Release please" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: deploy staging stack - run: | - docker build . --cache-from "registry.wimill.xyz/windmill:staging" -t "registry.wimill.xyz/windmill:staging" --build-arg BUILDKIT_INLINE_CACHE=1 - docker push "registry.wimill.xyz/windmill:staging" - - name: deploy demo stack - if: github.ref == 'refs/heads/main' - run: | - docker tag registry.wimill.xyz/windmill:staging registry.wimill.xyz/windmill:main - docker push registry.wimill.xyz/windmill:main - # - name: pruning unused images - # run: sudo docker image prune -a + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Docker meta local + id: metalocal + uses: docker/metadata-action@v4 + with: + images: ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Login to registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: | + ${{ steps.metalocal.outputs.tags }} + ${{ steps.meta.outputs.tags }} + + labels: ${{ steps.metalocal.outputs.labels }} + cache-from: type=registry,ref=registry.wimill.xyz/windmilllabs/windmill:buildcache + cache-to: type=registry,ref=registry.wimill.xyz/windmilllabs/windmill:buildcache,mode=max diff --git a/.github/workflows/lsp_on_release.yml b/.github/workflows/lsp_on_release.yml new file mode 100644 index 0000000000..c834395cbe --- /dev/null +++ b/.github/workflows/lsp_on_release.yml @@ -0,0 +1,37 @@ +name: Publish LSP Server +on: + push: + branches: [main] + paths: + - "python-client/*W" + - "lsp/*" + tags: + - "*" +jobs: + build: + runs-on: [self-hosted, new] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Docker meta local + id: metalocal + uses: docker/metadata-action@v4 + with: + images: registry.wimill.xyz/windmilllabs/lsp + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: "{{defaultContext}}:lsp" + push: true + tags: ${{ steps.metalocal.outputs.tags }} + labels: ${{ steps.metalocal.outputs.labels }} + cache-from: type=registry,ref=registry.wimill.xyz/windmilllabs/lsp:buildcache + cache-to: type=registry,ref=registry.wimill.xyz/windmilllabs/lsp:buildcache,mode=max diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml deleted file mode 100644 index 3ec799fc6c..0000000000 --- a/.github/workflows/on-release.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build LSP Docker -on: - push: - branches: [main] - paths: - - "python-client/**" - - "Pipfile" - - ".github/workflows/on-release.yml" - -jobs: - build_lsp: - runs-on: [self-hosted, new] - steps: - - name: Wait for release to succeed - if: github.ref == 'refs/heads/main' - uses: lewagon/wait-on-check-action@v1.0.0 - with: - ref: ${{ github.ref }} - check-name: "Release please" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - - uses: actions/checkout@v2 - - name: Upload python client - env: - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - cd python-client - export PATH=$PATH:/usr/local/bin - export PATH=$PATH:/root/.local/bin - ./publish.sh - - name: Build the Docker image - run: | - cd lsp - sudo docker pull "registry.wimill.xyz/lsp:main" || true - sudo docker build . --cache-from "registry.wimill.xyz/lsp:main" -t "registry.wimill.xyz/lsp:main" --build-arg BUILDKIT_INLINE_CACHE=1 - - name: push to registry - run: | - sudo docker push "registry.wimill.xyz/lsp:main" diff --git a/.github/workflows/pypi_on_release.yml b/.github/workflows/pypi_on_release.yml new file mode 100644 index 0000000000..e4f6177284 --- /dev/null +++ b/.github/workflows/pypi_on_release.yml @@ -0,0 +1,19 @@ +name: Publish python-client +on: + push: + tags: + - "v*" + +jobs: + build_lsp: + runs-on: [self-hosted, new] + steps: + - uses: actions/checkout@v2 + - name: Upload python client + env: + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + cd python-client + export PATH=$PATH:/usr/local/bin + export PATH=$PATH:/root/.local/bin + ./publish.sh diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 8b23cc11b8..caab9452aa 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,7 +1,7 @@ on: push: - branches: - - main + branches: [main] + name: release-please jobs: release-please: