diff --git a/.github/workflows/Build_Test_Pull_Request.yml b/.github/workflows/Build_Test_Pull_Request.yml new file mode 100644 index 000000000..0dbca646a --- /dev/null +++ b/.github/workflows/Build_Test_Pull_Request.yml @@ -0,0 +1,55 @@ +name: Build Pull Request Contents + +on: + pull_request: + types: ["opened", "synchronize"] + +jobs: + build-pull-request-contents: + name: Build Pull Request Contents + runs-on: ubuntu-20.04 + permissions: + pull-requests: read + + steps: + - name: Checkout Repository to Actions + uses: actions/checkout@v3.3.0 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v2 + with: + node-version: 18.x + cache: 'yarn' + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v38 + with: + files_yaml: | + apiserver: + - apiserver/** + web: + - apps/app/** + deploy: + - apps/space/** + + - name: Setup .npmrc for repository + run: | + echo -e "@tiptap-pro:registry=https://registry.tiptap.dev/\n//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_TOKEN }}" > .npmrc + + - name: Build Plane's Main App + if: steps.changed-files.outputs.web_any_changed == 'true' + run: | + mv ./.npmrc ./apps/app + cd apps/app + yarn + yarn build + + - name: Build Plane's Deploy App + if: steps.changed-files.outputs.deploy_any_changed == 'true' + run: | + cd apps/space + yarn + yarn build + + diff --git a/.github/workflows/Update_Docker_Images.yml b/.github/workflows/Update_Docker_Images.yml new file mode 100644 index 000000000..8e27e098f --- /dev/null +++ b/.github/workflows/Update_Docker_Images.yml @@ -0,0 +1,111 @@ +name: Update Docker Images for Plane on Release + +on: + release: + types: [released] + +jobs: + build_push_backend: + name: Build and Push Api Server Docker Image + runs-on: ubuntu-20.04 + + steps: + - name: Check out the repo + uses: actions/checkout@v3.3.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.5.0 + + - name: Login to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Setup .npmrc for repository + run: | + echo -e "@tiptap-pro:registry=https://registry.tiptap.dev/\n//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_TOKEN }}" > .npmrc + + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + id: metaFrontend + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend + tags: | + type=ref,event=tag + + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + id: metaBackend + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend + tags: | + type=ref,event=tag + + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + id: metaDeploy + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-deploy + tags: | + type=ref,event=tag + + - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release + id: metaProxy + uses: docker/metadata-action@v4.3.0 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy + tags: | + type=ref,event=tag + + - name: Build and Push Frontend to Docker Container Registry + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./apps/app/Dockerfile.web + platforms: linux/amd64 + tags: ${{ steps.metaFrontend.outputs.tags }} + push: true + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Backend to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: ./apiserver + file: ./apiserver/Dockerfile.api + platforms: linux/amd64 + push: true + tags: ${{ steps.metaBackend.outputs.tags }} + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Plane-Deploy to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: . + file: ./apps/space/Dockerfile.space + platforms: linux/amd64 + push: true + tags: ${{ steps.metaDeploy.outputs.tags }} + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Plane-Proxy to Docker Hub + uses: docker/build-push-action@v4.0.0 + with: + context: ./nginx + file: ./nginx/Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ steps.metaProxy.outputs.tags }} + env: + DOCKER_BUILDKIT: 1 + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/push-image-backend.yml b/.github/workflows/push-image-backend.yml deleted file mode 100644 index 9ca34790b..000000000 --- a/.github/workflows/push-image-backend.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Build and Push Backend Docker Image - -on: - pull_request: - types: [closed] - branches: [develop] - release: - types: [released] - -jobs: - build_push_backend: - name: Build and Push Api Server Docker Image - runs-on: ubuntu-20.04 - - steps: - - name: Check out the repo - uses: actions/checkout@v3.3.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 - - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Pull Request - id: meta_pr - if: ${{ github.event_name == 'pull_request' }} - uses: docker/metadata-action@v4.3.0 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend - tags: type=raw,value=develop - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - id: meta - uses: docker/metadata-action@v4.3.0 - if: ${{ github.event_name == 'release' }} - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend - tags: | - type=ref,event=tag - - - name: Build and Push to Docker Hub - uses: docker/build-push-action@v4.0.0 - with: - context: ./apiserver - file: ./apiserver/Dockerfile.api - platforms: linux/amd64 - push: true - tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || steps.meta_pr.outputs.tags }} - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - diff --git a/.github/workflows/push-image-deploy.yml b/.github/workflows/push-image-deploy.yml deleted file mode 100644 index 4a689bd29..000000000 --- a/.github/workflows/push-image-deploy.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Build and Push Plane Deploy Docker Image - -on: - pull_request: - types: [closed] - branches: [develop] - release: - types: [released] - -jobs: - build_push_plane_deploy: - name: Build and Push Plane Deploy Docker Image - runs-on: ubuntu-20.04 - - steps: - - name: Check out the repo - uses: actions/checkout@v3.3.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 - - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Pull Request - id: meta_pr - if: ${{ github.event_name == 'pull_request' }} - uses: docker/metadata-action@v4.3.0 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-deploy - tags: type=raw,value=develop - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - id: meta - uses: docker/metadata-action@v4.3.0 - if: ${{ github.event_name == 'release' }} - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-deploy - tags: | - type=ref,event=tag - - - name: Build and Push to Docker Hub - uses: docker/build-push-action@v4.0.0 - with: - context: . - file: ./apps/space/Dockerfile.space - platforms: linux/amd64 - push: true - tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || steps.meta_pr.outputs.tags }} - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - diff --git a/.github/workflows/push-image-frontend.yml b/.github/workflows/push-image-frontend.yml deleted file mode 100644 index 69d24e128..000000000 --- a/.github/workflows/push-image-frontend.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Build and Push Frontend Docker Image - -on: - pull_request: - types: [closed] - branches: [develop] - release: - types: [released] - -jobs: - build_push_frontend: - name: Build Frontend Docker Image - runs-on: ubuntu-20.04 - steps: - - name: Check out the repo - uses: actions/checkout@v3.3.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 - - - name: Setup .npmrc for repository - run: | - echo -e "@tiptap-pro:registry=https://registry.tiptap.dev/\n//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_TOKEN }}" > .npmrc - - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - id: meta - if: ${{ github.event_name == 'release' }} - uses: docker/metadata-action@v4.3.0 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend - tags: | - type=ref,event=tag - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Pull Request - id: meta_pr - if: ${{ github.event_name == 'pull_request' }} - uses: docker/metadata-action@v4.3.0 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend - tags: type=raw,value=develop - - - name: Build and Push to Docker Container Registry - uses: docker/build-push-action@v4.0.0 - with: - context: . - file: ./apps/app/Dockerfile.web - platforms: linux/amd64 - tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || steps.meta_pr.outputs.tags }} - push: true - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - diff --git a/.github/workflows/push-image-proxy.yml b/.github/workflows/push-image-proxy.yml deleted file mode 100644 index e053c8aa9..000000000 --- a/.github/workflows/push-image-proxy.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build and Push Proxy Docker Image - -on: - pull_request: - types: [closed] - branches: [develop] - release: - types: [released] - -jobs: - build_push_proxy: - name: Build and Push Proxy Docker Image - runs-on: ubuntu-20.04 - - steps: - - name: Check out the repo - uses: actions/checkout@v3.3.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 - - - name: Login to Docker Hub - uses: docker/login-action@v2.1.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Pull Request - id: meta_pr - if: ${{ github.event_name == 'pull_request' }} - uses: docker/metadata-action@v4.3.0 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy - tags: type=raw,value=develop - - - name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release - id: meta - uses: docker/metadata-action@v4.3.0 - if: ${{ github.event_name == 'release' }} - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy - tags: | - type=ref,event=tag - - - name: Build and Push to Docker Hub - uses: docker/build-push-action@v4.0.0 - with: - context: ./nginx - file: ./nginx/Dockerfile - platforms: linux/amd64 - push: true - tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || steps.meta_pr.outputs.tags }} - env: - DOCKER_BUILDKIT: 1 - DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}