diff --git a/.github/workflows/analytics.yml b/.github/workflows/analytics.yml index 2217ebdbe..57caa4fd0 100644 --- a/.github/workflows/analytics.yml +++ b/.github/workflows/analytics.yml @@ -11,9 +11,9 @@ on: workflow_dispatch: jobs: - call_server_utility_workflow: - name: Server Utility - uses: standardnotes/server/.github/workflows/common-server-utility.yml@main + call_server_application_workflow: + name: Server Application + uses: standardnotes/server/.github/workflows/common-server-application.yml@main with: service_name: analytics workspace_name: "@standardnotes/analytics" @@ -22,7 +22,7 @@ jobs: secrets: inherit newrelic: - needs: call_server_utility_workflow + needs: call_server_application_workflow runs-on: ubuntu-latest diff --git a/.github/workflows/api-gateway.yml b/.github/workflows/api-gateway.yml index 32bc1d954..1a7af9db3 100644 --- a/.github/workflows/api-gateway.yml +++ b/.github/workflows/api-gateway.yml @@ -17,7 +17,6 @@ jobs: with: service_name: api-gateway workspace_name: "@standardnotes/api-gateway" - e2e_tag_parameter_name: api_gateway_image_tag deploy_worker: false package_path: packages/api-gateway secrets: inherit diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml index aa40fc3ce..034ee59cd 100644 --- a/.github/workflows/auth.yml +++ b/.github/workflows/auth.yml @@ -17,7 +17,6 @@ jobs: with: service_name: auth workspace_name: "@standardnotes/auth-server" - e2e_tag_parameter_name: auth_image_tag package_path: packages/auth secrets: inherit diff --git a/.github/workflows/common-docker-image.yml b/.github/workflows/common-docker-image.yml index 573d99e1e..998537e66 100644 --- a/.github/workflows/common-docker-image.yml +++ b/.github/workflows/common-docker-image.yml @@ -6,9 +6,6 @@ on: service_name: required: true type: string - bundle_dir: - required: true - type: string package_path: required: true type: string @@ -32,13 +29,17 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Create Bundle Dir + id: bundle-dir + run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT + - name: Cache build id: cache-build uses: actions/cache@v3 with: path: | packages/**/dist - ${{ inputs.bundle_dir }} + ${{ steps.bundle-dir.outputs.temp_dir }} key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - name: Set up Node @@ -53,7 +54,7 @@ jobs: - name: Bundle if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ inputs.bundle_dir }} + run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }} - name: Login to Docker Hub uses: docker/login-action@v2 @@ -85,8 +86,8 @@ jobs: uses: docker/build-push-action@v3 with: builder: ${{ steps.buildx.outputs.name }} - context: ${{ inputs.bundle_dir }} - file: ${{ inputs.bundle_dir }}/${{ inputs.package_path }}/Dockerfile + context: ${{ steps.bundle-dir.outputs.temp_dir }} + file: ${{ steps.bundle-dir.outputs.temp_dir }}/${{ inputs.package_path }}/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: | diff --git a/.github/workflows/common-server-application.yml b/.github/workflows/common-server-application.yml index 1a39ad6be..5aede9c5f 100644 --- a/.github/workflows/common-server-application.yml +++ b/.github/workflows/common-server-application.yml @@ -17,9 +17,6 @@ on: required: false default: true type: boolean - e2e_tag_parameter_name: - required: false - type: string package_path: required: true type: string @@ -36,177 +33,11 @@ on: required: true jobs: - build: - runs-on: ubuntu-latest - - outputs: - temp_dir: ${{ steps.bundle-dir.outputs.temp_dir }} - - steps: - - uses: actions/checkout@v3 - - - name: Create Bundle Dir - id: bundle-dir - run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ steps.bundle-dir.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - run: yarn build ${{ inputs.package_path }} - - - name: Bundle - run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }} - - lint: - runs-on: ubuntu-latest - - needs: build - - steps: - - uses: actions/checkout@v3 - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ needs.build.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn build ${{ inputs.package_path }} - - - name: Lint - run: yarn lint:${{ inputs.service_name }} - - test: - runs-on: ubuntu-latest - - needs: build - - steps: - - uses: actions/checkout@v3 - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ needs.build.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn build ${{ inputs.package_path }} - - - name: Test - run: yarn test ${{ inputs.package_path }} - - e2e: - runs-on: ubuntu-latest - - needs: build - - steps: - - uses: actions/checkout@v3 - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ needs.build.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn build ${{ inputs.package_path }} - - - name: Bundle - if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ needs.build.outputs.temp_dir }} - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Publish Docker image for E2E testing - uses: docker/build-push-action@v3 - with: - builder: ${{ steps.buildx.outputs.name }} - context: ${{ needs.build.outputs.temp_dir }} - file: ${{ needs.build.outputs.temp_dir }}/${{ inputs.package_path }}/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: standardnotes/${{ inputs.service_name }}:${{ github.sha }} - - - name: Run E2E test suite - uses: convictional/trigger-workflow-and-wait@master - with: - owner: standardnotes - repo: self-hosted - github_token: ${{ secrets.CI_PAT_TOKEN }} - workflow_file_name: testing-with-updating-client-and-server.yml - wait_interval: 30 - client_payload: '{"${{ inputs.e2e_tag_parameter_name }}": "${{ github.sha }}"}' - propagate_failure: true - trigger_workflow: true - wait_workflow: true - publish: - needs: [ build, test, lint, e2e ] - name: Publish Docker Image uses: standardnotes/server/.github/workflows/common-docker-image.yml@main with: service_name: ${{ inputs.service_name }} - bundle_dir: ${{ needs.build.outputs.temp_dir }} package_path: ${{ inputs.package_path }} workspace_name: ${{ inputs.workspace_name }} secrets: inherit diff --git a/.github/workflows/common-server-utility.yml b/.github/workflows/common-server-utility.yml deleted file mode 100644 index c9209a85b..000000000 --- a/.github/workflows/common-server-utility.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: Reusable Server Utility Workflow - -on: - workflow_call: - inputs: - service_name: - required: true - type: string - workspace_name: - required: true - type: string - deploy_web: - required: false - default: true - type: boolean - deploy_worker: - required: false - default: true - type: boolean - package_path: - required: true - type: string - secrets: - DOCKER_USERNAME: - required: true - DOCKER_PASSWORD: - required: true - CI_PAT_TOKEN: - required: true - AWS_ACCESS_KEY_ID: - required: true - AWS_SECRET_ACCESS_KEY: - required: true - -jobs: - build: - runs-on: ubuntu-latest - - outputs: - temp_dir: ${{ steps.bundle-dir.outputs.temp_dir }} - - steps: - - uses: actions/checkout@v3 - - - name: Create Bundle Dir - id: bundle-dir - run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ steps.bundle-dir.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - run: yarn build ${{ inputs.package_path }} - - - name: Bundle - run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }} - - lint: - runs-on: ubuntu-latest - - needs: build - - steps: - - uses: actions/checkout@v3 - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ needs.build.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn build ${{ inputs.package_path }} - - - name: Lint - run: yarn lint:${{ inputs.service_name }} - - test: - runs-on: ubuntu-latest - - needs: build - - steps: - - uses: actions/checkout@v3 - - - name: Cache build - id: cache-build - uses: actions/cache@v3 - with: - path: | - packages/**/dist - ${{ needs.build.outputs.temp_dir }} - key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }} - - - name: Set up Node - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - node-version-file: '.nvmrc' - - - name: Build - if: steps.cache-build.outputs.cache-hit != 'true' - run: yarn build ${{ inputs.package_path }} - - - name: Test - run: yarn test ${{ inputs.package_path }} - - publish: - needs: [ build, test, lint ] - - name: Publish Docker Image - uses: standardnotes/server/.github/workflows/common-docker-image.yml@main - with: - service_name: ${{ inputs.service_name }} - bundle_dir: ${{ needs.build.outputs.temp_dir }} - package_path: ${{ inputs.package_path }} - workspace_name: ${{ inputs.workspace_name }} - secrets: inherit - - deploy-web: - if: ${{ inputs.deploy_web }} - - needs: publish - - name: Deploy Web - uses: standardnotes/server/.github/workflows/common-deploy.yml@main - with: - service_name: ${{ inputs.service_name }} - docker_image: ${{ inputs.service_name }}:${{ github.sha }} - secrets: inherit - - deploy-worker: - if: ${{ inputs.deploy_worker }} - - needs: publish - - name: Deploy Worker - uses: standardnotes/server/.github/workflows/common-deploy.yml@main - with: - service_name: ${{ inputs.service_name }}-worker - docker_image: ${{ inputs.service_name }}:${{ github.sha }} - secrets: inherit diff --git a/.github/workflows/event-store.yml b/.github/workflows/event-store.yml index b3b77c72c..790344957 100644 --- a/.github/workflows/event-store.yml +++ b/.github/workflows/event-store.yml @@ -11,9 +11,9 @@ on: workflow_dispatch: jobs: - call_server_utility_workflow: - name: Server Utility - uses: standardnotes/server/.github/workflows/common-server-utility.yml@main + call_server_application_workflow: + name: Server Application + uses: standardnotes/server/.github/workflows/common-server-application.yml@main with: service_name: event-store workspace_name: "@standardnotes/event-store" @@ -22,7 +22,7 @@ jobs: secrets: inherit newrelic: - needs: call_server_utility_workflow + needs: call_server_application_workflow runs-on: ubuntu-latest diff --git a/.github/workflows/files.yml b/.github/workflows/files.yml index 122b095bb..47b9f29c7 100644 --- a/.github/workflows/files.yml +++ b/.github/workflows/files.yml @@ -17,7 +17,6 @@ jobs: with: service_name: files workspace_name: "@standardnotes/files-server" - e2e_tag_parameter_name: files_image_tag package_path: packages/files secrets: inherit diff --git a/.github/workflows/revisions.yml b/.github/workflows/revisions.yml index 089885665..6cdf974e4 100644 --- a/.github/workflows/revisions.yml +++ b/.github/workflows/revisions.yml @@ -17,7 +17,6 @@ jobs: with: service_name: revisions workspace_name: "@standardnotes/revisions-server" - e2e_tag_parameter_name: revisions_image_tag package_path: packages/revisions secrets: inherit diff --git a/.github/workflows/scheduler.yml b/.github/workflows/scheduler.yml index f9f84a131..434d0aafd 100644 --- a/.github/workflows/scheduler.yml +++ b/.github/workflows/scheduler.yml @@ -11,9 +11,9 @@ on: workflow_dispatch: jobs: - call_server_utility_workflow: - name: Server Utility - uses: standardnotes/server/.github/workflows/common-server-utility.yml@main + call_server_application_workflow: + name: Server Application + uses: standardnotes/server/.github/workflows/common-server-application.yml@main with: service_name: scheduler workspace_name: "@standardnotes/scheduler-server" @@ -22,7 +22,7 @@ jobs: secrets: inherit newrelic: - needs: call_server_utility_workflow + needs: call_server_application_workflow runs-on: ubuntu-latest diff --git a/.github/workflows/syncing-server.yml b/.github/workflows/syncing-server.yml index 9226baaa5..77f7c9bd1 100644 --- a/.github/workflows/syncing-server.yml +++ b/.github/workflows/syncing-server.yml @@ -17,7 +17,6 @@ jobs: with: service_name: syncing-server-js workspace_name: "@standardnotes/syncing-server" - e2e_tag_parameter_name: syncing_server_js_image_tag package_path: packages/syncing-server secrets: inherit diff --git a/.github/workflows/websockets.yml b/.github/workflows/websockets.yml index 4dd55296f..6e1a11e33 100644 --- a/.github/workflows/websockets.yml +++ b/.github/workflows/websockets.yml @@ -11,9 +11,9 @@ on: workflow_dispatch: jobs: - call_server_utility_workflow: - name: Server Utility - uses: standardnotes/server/.github/workflows/common-server-utility.yml@main + call_server_application_workflow: + name: Server Application + uses: standardnotes/server/.github/workflows/common-server-application.yml@main with: service_name: websockets workspace_name: "@standardnotes/websockets-server" @@ -21,7 +21,7 @@ jobs: secrets: inherit newrelic: - needs: call_server_utility_workflow + needs: call_server_application_workflow runs-on: ubuntu-latest steps: diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index deadc10dd..914604b75 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -11,9 +11,9 @@ on: workflow_dispatch: jobs: - call_server_utility_workflow: - name: Server Utility - uses: standardnotes/server/.github/workflows/common-server-utility.yml@main + call_server_application_workflow: + name: Server Application + uses: standardnotes/server/.github/workflows/common-server-application.yml@main with: service_name: workspace workspace_name: "@standardnotes/workspace-server" @@ -21,7 +21,7 @@ jobs: secrets: inherit newrelic: - needs: call_server_utility_workflow + needs: call_server_application_workflow runs-on: ubuntu-latest steps: