From ba46931979739b4c75d9db9aabb30eb10d1fa348 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 10 Jul 2023 08:28:23 +0100 Subject: [PATCH] add docker jobs for link shortner --- .github/workflows/compile.yml | 14 ++++++++++++++ .github/workflows/docker-build.yml | 15 +++++++++++++++ .github/workflows/release.yml | 22 ++++++++++++++++++++++ .github/workflows/test-release.yml | 20 ++++++++++++++++++++ 4 files changed, 71 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 9645506e7f..ddd883ac19 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -39,6 +39,20 @@ jobs: - run: cd CommonServer && npm install - run: cd ApiReference && npm install && npm run compile + compile-link-shortner: + runs-on: ubuntu-latest + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + - run: cd Common && npm install + - run: cd Model && npm install + - run: cd CommonServer && npm install + - run: cd LinkShortner && npm install && npm run compile + compile-common-server: runs-on: ubuntu-latest env: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6ae65f2654..ca60bd6c67 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -25,6 +25,21 @@ jobs: - name: build docker image run: sudo docker build -f ./Accounts/Dockerfile . + docker-build-link-shortner: + runs-on: ubuntu-latest + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Preinstall + run: npm run prerun + + # build image for accounts service + - name: build docker image + run: sudo docker build -f ./LinkShortner/Dockerfile . + docker-build-api-reference: runs-on: ubuntu-latest env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c881c0f60..87992e57ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,6 +87,28 @@ jobs: - run: sudo docker buildx create --use - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:$ONEUPTIME_VERSION --tag oneuptime/workflow:release --push -f ./Workflow/Dockerfile . + link-shortner-docker-image-deploy: + needs: generate-build-number + runs-on: ubuntu-latest + env: + DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}} + DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}} + ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}" + steps: + - uses: actions/checkout@v3 + with: + ref: release + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + + - run: npm run prerun + - run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 + # Build and deploy accounts. + - run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD + - run: sudo docker buildx create --use + - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/link-shortner:$ONEUPTIME_VERSION --tag oneuptime/link-shortner:release --push -f ./LinkShortner/Dockerfile . + workers-docker-image-deploy: needs: generate-build-number runs-on: ubuntu-latest diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 026b42ad2f..41456fbeb5 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -39,6 +39,26 @@ jobs: - run: sudo docker buildx create --use - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/test-server:$ONEUPTIME_VERSION-test --tag oneuptime/test-server:test --push -f ./TestServer/Dockerfile . + link-shortner-test-docker-image-deploy: + needs: generate-build-number + runs-on: ubuntu-latest + env: + DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}} + DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}} + ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}" + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + + - run: npm run prerun + - run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 + # Build and deploy accounts. + - run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD + - run: sudo docker buildx create --use + - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/link-shortner:$ONEUPTIME_VERSION-test --tag oneuptime/link-shortner:test --push -f ./LinkShortner/Dockerfile . + workflow-test-docker-image-deploy: needs: generate-build-number runs-on: ubuntu-latest