From a491633015d03bda3982f94f4b01eef8642df855 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 13:50:47 +0100 Subject: [PATCH 01/26] [#475]: deploy to swarm action update --- .deploy/blog.deploy.yml | 3 +- .deploy/gamehub.deploy.yml | 3 +- .deploy/ligretto.deploy.yml | 9 +++-- .github/actions/deploy-to-swarm/action.yml | 41 +++++++++------------- .github/workflows/blog-deploy.yml | 9 +++-- .github/workflows/gamehub-deploy.yml | 7 ++-- .github/workflows/ligretto-deploy.yml | 7 ++-- .vscode/settings.json | 2 +- 8 files changed, 38 insertions(+), 43 deletions(-) diff --git a/.deploy/blog.deploy.yml b/.deploy/blog.deploy.yml index 58acd194..bdfb4eab 100644 --- a/.deploy/blog.deploy.yml +++ b/.deploy/blog.deploy.yml @@ -10,7 +10,8 @@ services: labels: - "traefik.enable=true" - "traefik.http.routers.blog.rule=Host(`blog.mems.fun`)" - - "traefik.http.routers.blog.entrypoints=web" + - "traefik.http.routers.blog.entrypoints=websecure" + - "traefik.http.routers.blog.tls=true" - "traefik.http.services.blog.loadbalancer.server.port=3000" - "traefik.http.services.blog.loadbalancer.passhostheader=true" replicas: 1 diff --git a/.deploy/gamehub.deploy.yml b/.deploy/gamehub.deploy.yml index 0079bc2a..f4bfc8fa 100644 --- a/.deploy/gamehub.deploy.yml +++ b/.deploy/gamehub.deploy.yml @@ -8,9 +8,10 @@ services: labels: - "traefik.enable=true" - "traefik.http.routers.gamehub-client.rule=Host(`mems.fun`)" - - "traefik.http.routers.gamehub-client.entrypoints=web" + - "traefik.http.routers.gamehub-client.entrypoints=websecure" - "traefik.http.services.gamehub-client.loadbalancer.server.port=3000" - "traefik.http.services.gamehub-client.loadbalancer.passhostheader=true" + - "traefik.http.routers.gamehub-client.tls=true" replicas: 1 update_config: parallelism: 2 diff --git a/.deploy/ligretto.deploy.yml b/.deploy/ligretto.deploy.yml index d5ba3c83..e3acd73b 100644 --- a/.deploy/ligretto.deploy.yml +++ b/.deploy/ligretto.deploy.yml @@ -19,7 +19,8 @@ services: - "prometheus-port=3005" - "traefik.enable=true" - "traefik.http.routers.ligretto-gameplay-backend.rule=Host(`api.ligretto.app`)" - - "traefik.http.routers.ligretto-gameplay-backend.entrypoints=web" + - "traefik.http.routers.ligretto-gameplay-backend.entrypoints=websecure" + - "traefik.http.routers.ligretto-gameplay-backend.tls=true" - "traefik.http.services.ligretto-gameplay-backend.loadbalancer.server.port=3005" - "traefik.http.services.ligretto-gameplay-backend.loadbalancer.passhostheader=true" replicas: 1 @@ -57,7 +58,8 @@ services: labels: - "traefik.enable=true" - "traefik.http.routers.ligretto-core-backend.rule=Host(`core.ligretto.app`)" - - "traefik.http.routers.ligretto-core-backend.entrypoints=web" + - "traefik.http.routers.ligretto-core-backend.entrypoints=websecure" + - "traefik.http.routers.ligretto-core-backend.tls=true" - "traefik.http.services.ligretto-core-backend.loadbalancer.server.port=3333" - "traefik.http.services.ligretto-core-backend.loadbalancer.passhostheader=true" replicas: 1 @@ -99,7 +101,8 @@ services: - "prometheus-port=8080" - "traefik.enable=true" - "traefik.http.routers.ligretto-bot-clj.rule=Host(`bots.ligretto.app`)" - - "traefik.http.routers.ligretto-bot-clj.entrypoints=web" + - "traefik.http.routers.ligretto-bot-clj.entrypoints=websecure" + - "traefik.http.routers.ligretto-bot-clj.tls=true" - "traefik.http.services.ligretto-bot-clj.loadbalancer.server.port=3222" - "traefik.http.services.ligretto-bot-clj.loadbalancer.passhostheader=true" replicas: 1 diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index 6b4d121e..a8807e18 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -7,21 +7,14 @@ inputs: name: required: true description: "Stack name" - AWS_ACCESS_KEY_ID: + sa_auth_key: required: true - description: 'AWS_ACCESS_KEY_ID' - AWS_SECRET_ACCESS_KEY: - required: true - description: 'AWS_SECRET_ACCESS_KEY' - AWS_REGION: - required: false - description: 'AWS region' - default: 'eu-north-1' - docker_login: + description: "https://cloud.yandex.ru/en/docs/iam/concepts/authorization/key" + docker_registry_login: required: false default: '' description: 'Docker login' - docker_password: + docker_registry_password: required: false default: '' description: 'Docker password' @@ -33,23 +26,23 @@ inputs: runs: using: "composite" steps: + - name: Install yc cli + id: install_yc_cli + run: curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash -s + + - name: Configure yc cli + id: configure_yc_cli + run: | + yc config profile create worker + echo ${{ inputs.sa_auth_key }} > key.json + yc config set service-account-key key.json + - name: Read stack file id: package uses: juliangruber/read-file-action@v1 with: path: ${{ inputs.path-to-stack }} - - uses: gagoar/invoke-aws-lambda@master - name: Invoke deploy to swarm lambda + - name: Invoke deploy to swarm lambda id: invoke-lambda - with: - AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} - REGION: ${{ inputs.AWS_REGION }} - FunctionName: deploy-stack-lambda - Payload: '{ "body": {"name": "${{ inputs.name }}", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' - - - name: Invoke logs - if: ${{ always() }} - shell: bash - run: echo "${{ steps.invoke-lambda.outputs.response }}" + run: yc serverless function invoke deploy-stack-lambda -d '{ "body": {"name": "${{ inputs.name }}", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 33abccf9..507d2960 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -5,7 +5,7 @@ on: branches: - master push: - branches: [ master ] + branches: [ master, 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud ] paths: - 'apps/blog/**' - '.deploy/blog.deploy.yml' @@ -66,8 +66,7 @@ jobs: with: path-to-stack: '.deploy/blog.deploy.yml' name: 'BLOG' - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - docker_login: ${{ secrets.GHCR_USER }} - docker_password: ${{ secrets.GHCR_PULL_TOKEN }} + sa_auth_key: ${{ secrets.YC_WORKER_KEY }} + docker_registry_login: ${{ secrets.GHCR_USER }} + docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index a9f8a4b2..2e35c6be 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -66,8 +66,7 @@ jobs: with: path-to-stack: '.deploy/gamehub.deploy.yml' name: 'GAMEHUB' - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - docker_login: ${{ secrets.GHCR_USER }} - docker_password: ${{ secrets.GHCR_PULL_TOKEN }} + sa_auth_key: ${{ secrets.YC_WORKER_KEY }} + docker_registry_login: ${{ secrets.GHCR_USER }} + docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index 900f1eb0..a9c0f55f 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -146,16 +146,15 @@ jobs: with: path-to-stack: '.deploy/ligretto.deploy.yml' name: 'LIGRETTO' - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - docker_login: ${{ secrets.GHCR_USER }} - docker_password: ${{ secrets.GHCR_PULL_TOKEN }} + docker_registry_login: ${{ secrets.GHCR_USER }} + docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' - uses: ./.github/actions/deploy-to-s3 name: Deploy to s3 with: path-to-folder: apps/ligretto-frontend/dist + sa_auth_key: ${{ secrets.YC_WORKER_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} bucket: 'lig-production-cdn-origin' diff --git a/.vscode/settings.json b/.vscode/settings.json index 6c0c5d03..555581d7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,6 +18,6 @@ "cSpell.words": ["injectable", "nestjs", "postgres", "styleguide", "typeorm"], "gitlens.advanced.blame.customArguments": [], "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" } } From 5209cdcf609db8c97a5add6e4b00bb4365feb1cd Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 13:53:26 +0100 Subject: [PATCH 02/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index a8807e18..7ac6241b 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -27,11 +27,13 @@ runs: using: "composite" steps: - name: Install yc cli + shell: bash id: install_yc_cli run: curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash -s - name: Configure yc cli id: configure_yc_cli + shell: bash run: | yc config profile create worker echo ${{ inputs.sa_auth_key }} > key.json From 9bf627ee82116e896bab49a5b422448104173668 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 13:54:48 +0100 Subject: [PATCH 03/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 507d2960..4bee2efe 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -11,6 +11,7 @@ on: - '.deploy/blog.deploy.yml' - '.docker/Blog_Dockerfile*' - '.github/workflows/blog-deploy.yml' + - '.github/actions/deploy-to-swarm/**' env: AWS_REGION: 'eu-north-1' From 3ff090b42c56eabde3e82896a43d2e5f9b87c2c0 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:08:24 +0100 Subject: [PATCH 04/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 3 ++- .github/workflows/blog-deploy.yml | 10 +++++----- .github/workflows/e2e.yml | 4 ++-- .github/workflows/gamehub-deploy.yml | 10 +++++----- .github/workflows/ligretto-deploy.yml | 20 ++++++++++---------- .github/workflows/pr.yml | 16 ++++++++-------- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index 7ac6241b..17e93e58 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -47,4 +47,5 @@ runs: - name: Invoke deploy to swarm lambda id: invoke-lambda - run: yc serverless function invoke deploy-stack-lambda -d '{ "body": {"name": "${{ inputs.name }}", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' + shell: bash + run: yc serverless function invoke deploy-stack-lambda -d '{ \"body\": {\"name\": \"${{ inputs.name }}\", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 4bee2efe..85c92d2f 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -19,11 +19,11 @@ env: jobs: build-blog-image: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -52,17 +52,17 @@ jobs: deploy: needs: [build-blog-image] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: name: Blog-production url: https://blog.mems.fun steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main name: Checkout - - uses: ./.github/actions/deploy-to-swarm + - uses: .github/actions/deploy-to-swarm name: Deploy to swarm lambda with: path-to-stack: '.deploy/blog.deploy.yml' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c07d4594..fa881e4c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -10,12 +10,12 @@ on: jobs: e2e: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Install node uses: actions/setup-node@v3 diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index 2e35c6be..f0968fd7 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -18,11 +18,11 @@ env: jobs: build-gamehub-client-image: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -51,17 +51,17 @@ jobs: deploy: needs: [build-gamehub-client-image] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: name: GameHub-production url: https://mems.fun steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main name: Checkout - - uses: ./.github/actions/deploy-to-swarm + - uses: .github/actions/deploy-to-swarm name: Deploy to swarm lambda with: path-to-stack: '.deploy/gamehub.deploy.yml' diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index a9c0f55f..3622d347 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -22,11 +22,11 @@ jobs: ligretto-frontend-build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Install node uses: actions/setup-node@v3 @@ -59,11 +59,11 @@ jobs: ligretto-gameplay-backend-image: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -91,11 +91,11 @@ jobs: ligretto-core-backend-image: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -124,14 +124,14 @@ jobs: deploy: needs: [ligretto-gameplay-backend-image, ligretto-core-backend-image, ligretto-frontend-build] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: name: Ligretto-production url: https://ligretto.app steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main name: Checkout - name: Download frontend dist @@ -141,7 +141,7 @@ jobs: name: frontend-dist path: apps/ligretto-frontend/dist - - uses: ./.github/actions/deploy-to-swarm + - uses: .github/actions/deploy-to-swarm name: Deploy to swarm lambda with: path-to-stack: '.deploy/ligretto.deploy.yml' @@ -150,7 +150,7 @@ jobs: docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' - - uses: ./.github/actions/deploy-to-s3 + - uses: .github/actions/deploy-to-s3 name: Deploy to s3 with: path-to-folder: apps/ligretto-frontend/dist diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e15558ef..adc41f16 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,11 +13,11 @@ jobs: lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Install node uses: actions/setup-node@v3 @@ -36,11 +36,11 @@ jobs: tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Install node uses: actions/setup-node@v3 @@ -72,11 +72,11 @@ jobs: tsc: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Install node uses: actions/setup-node@v3 @@ -114,12 +114,12 @@ jobs: --health-timeout 5s --health-retries 5 - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@main - name: Install node uses: actions/setup-node@v3 From ab3ef4a3821f595e536b715184275dea99ec0745 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:10:42 +0100 Subject: [PATCH 05/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 4 ++-- .github/workflows/gamehub-deploy.yml | 2 +- .github/workflows/ligretto-deploy.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 85c92d2f..27e755d0 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -11,7 +11,7 @@ on: - '.deploy/blog.deploy.yml' - '.docker/Blog_Dockerfile*' - '.github/workflows/blog-deploy.yml' - - '.github/actions/deploy-to-swarm/**' + - './.github/actions/deploy-to-swarm/**' env: AWS_REGION: 'eu-north-1' @@ -62,7 +62,7 @@ jobs: - uses: actions/checkout@main name: Checkout - - uses: .github/actions/deploy-to-swarm + - uses: ./.github/actions/deploy-to-swarm name: Deploy to swarm lambda with: path-to-stack: '.deploy/blog.deploy.yml' diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index f0968fd7..e3ed4c52 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@main name: Checkout - - uses: .github/actions/deploy-to-swarm + - uses: ./.github/actions/deploy-to-swarm name: Deploy to swarm lambda with: path-to-stack: '.deploy/gamehub.deploy.yml' diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index 3622d347..c53891ba 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -141,7 +141,7 @@ jobs: name: frontend-dist path: apps/ligretto-frontend/dist - - uses: .github/actions/deploy-to-swarm + - uses: ./.github/actions/deploy-to-swarm name: Deploy to swarm lambda with: path-to-stack: '.deploy/ligretto.deploy.yml' @@ -150,7 +150,7 @@ jobs: docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' - - uses: .github/actions/deploy-to-s3 + - uses: ./.github/actions/deploy-to-s3 name: Deploy to s3 with: path-to-folder: apps/ligretto-frontend/dist From 82f68e7facddf628f5df33248d9e469730262b60 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:24:54 +0100 Subject: [PATCH 06/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index 17e93e58..5799e8b1 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -48,4 +48,5 @@ runs: - name: Invoke deploy to swarm lambda id: invoke-lambda shell: bash - run: yc serverless function invoke deploy-stack-lambda -d '{ \"body\": {\"name\": \"${{ inputs.name }}\", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' + run: | + yc serverless function invoke deploy-stack-lambda -d '{ "body": {"name": "${{ inputs.name }}", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' From ddf4aabbc0f5b8d1fa61df042e4dfec237a66086 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:26:07 +0100 Subject: [PATCH 07/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 27e755d0..45926f5d 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -11,7 +11,7 @@ on: - '.deploy/blog.deploy.yml' - '.docker/Blog_Dockerfile*' - '.github/workflows/blog-deploy.yml' - - './.github/actions/deploy-to-swarm/**' + - '.github/actions/deploy-to-swarm/**' env: AWS_REGION: 'eu-north-1' From af6142c38d1a7c8ce6dff1d5b65fc85102e7e47b Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:29:36 +0100 Subject: [PATCH 08/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index 5799e8b1..4feca5ce 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -29,7 +29,7 @@ runs: - name: Install yc cli shell: bash id: install_yc_cli - run: curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash -s + run: curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash -s -- -i /opt/yandex-cloud -n && ln -s /opt/yandex-cloud/bin/yc /usr/local/bin/yc - name: Configure yc cli id: configure_yc_cli From 72724c893e7eb345e67050c475dd2054fcf30001 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:42:47 +0100 Subject: [PATCH 09/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 2 +- .github/workflows/blog-deploy.yml | 2 -- .github/workflows/gamehub-deploy.yml | 2 -- .github/workflows/ligretto-deploy.yml | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index 4feca5ce..c7d0c445 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -36,7 +36,7 @@ runs: shell: bash run: | yc config profile create worker - echo ${{ inputs.sa_auth_key }} > key.json + echo "${{ inputs.sa_auth_key }}" > key.json yc config set service-account-key key.json - name: Read stack file diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 45926f5d..1838c714 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -13,8 +13,6 @@ on: - '.github/workflows/blog-deploy.yml' - '.github/actions/deploy-to-swarm/**' -env: - AWS_REGION: 'eu-north-1' jobs: diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index e3ed4c52..ce8ad672 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -12,8 +12,6 @@ on: - '.docker/GameHub-client_Dockerfile*' - '.github/workflows/gamehub-deploy.yml' -env: - AWS_REGION: 'eu-north-1' jobs: diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index c53891ba..81148e6d 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -15,8 +15,6 @@ on: - '.docker' - '!.docker/Ligretto*' -env: - AWS_REGION: 'eu-north-1' jobs: From 3153ee25d2c7ff8073e576cf636088dac5c6a9cf Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:50:15 +0100 Subject: [PATCH 10/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index c7d0c445..dd8dc49b 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -36,7 +36,7 @@ runs: shell: bash run: | yc config profile create worker - echo "${{ inputs.sa_auth_key }}" > key.json + printf ${{ inputs.sa_auth_key }} > key.json yc config set service-account-key key.json - name: Read stack file From cb79e9dfe25bfc29373858247fcd9db1c1e9e51b Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 14:55:02 +0100 Subject: [PATCH 11/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index dd8dc49b..da7779dc 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -36,7 +36,7 @@ runs: shell: bash run: | yc config profile create worker - printf ${{ inputs.sa_auth_key }} > key.json + echo "${{ inputs.sa_auth_key }}" | base64 -d > key.json yc config set service-account-key key.json - name: Read stack file From 7b1eb57f73548f2ef58c0715e846bb3fa48e0b2f Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 15:01:19 +0100 Subject: [PATCH 12/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index da7779dc..e3429c20 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -36,7 +36,9 @@ runs: shell: bash run: | yc config profile create worker - echo "${{ inputs.sa_auth_key }}" | base64 -d > key.json + cat << 'EOF' > key.json + ${{ inputs.sa_auth_key }} + EOF yc config set service-account-key key.json - name: Read stack file From 5872266af3d0584a04643febebd695e4620bf114 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 15:02:46 +0100 Subject: [PATCH 13/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index e3429c20..fe86fa78 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -51,4 +51,4 @@ runs: id: invoke-lambda shell: bash run: | - yc serverless function invoke deploy-stack-lambda -d '{ "body": {"name": "${{ inputs.name }}", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' + yc serverless function invoke deploy-stack -d '{ "body": {"name": "${{ inputs.name }}", "stack": ${{ toJSON(steps.package.outputs.content) }}, "dockerLogin": ${{ toJSON(inputs.docker_registry_login) }}, "dockerPassword": ${{ toJSON(inputs.docker_registry_password) }}, "dockerRegistry": ${{ toJSON(inputs.docker_registry) }} } }' From 8c74778535276a15152e982966e39f0f8d780a82 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 15:08:07 +0100 Subject: [PATCH 14/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 3 +++ .github/workflows/blog-deploy.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index fe86fa78..cafcecee 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -7,6 +7,8 @@ inputs: name: required: true description: "Stack name" + yc_folder_id: + required: true sa_auth_key: required: true description: "https://cloud.yandex.ru/en/docs/iam/concepts/authorization/key" @@ -41,6 +43,7 @@ runs: EOF yc config set service-account-key key.json + - name: Read stack file id: package uses: juliangruber/read-file-action@v1 diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 1838c714..480b831a 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -66,6 +66,7 @@ jobs: path-to-stack: '.deploy/blog.deploy.yml' name: 'BLOG' sa_auth_key: ${{ secrets.YC_WORKER_KEY }} + yc_folder_id": 'b1gomjd9naqavtbdh4rp' docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' From 5d05e6a6e7fc7c64f75aea6f198c57fda0daa628 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 15:10:06 +0100 Subject: [PATCH 15/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-swarm/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/deploy-to-swarm/action.yml b/.github/actions/deploy-to-swarm/action.yml index cafcecee..a624e259 100644 --- a/.github/actions/deploy-to-swarm/action.yml +++ b/.github/actions/deploy-to-swarm/action.yml @@ -42,6 +42,7 @@ runs: ${{ inputs.sa_auth_key }} EOF yc config set service-account-key key.json + yc config set folder-id ${{ inputs.yc_folder_id }} - name: Read stack file From e8bdc81ac43b1742632b67d090ce595fecf9cf21 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 3 Mar 2024 15:11:38 +0100 Subject: [PATCH 16/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 480b831a..dad6c6ef 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -66,7 +66,7 @@ jobs: path-to-stack: '.deploy/blog.deploy.yml' name: 'BLOG' sa_auth_key: ${{ secrets.YC_WORKER_KEY }} - yc_folder_id": 'b1gomjd9naqavtbdh4rp' + yc_folder_id: 'b1gomjd9naqavtbdh4rp' docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' From d65a334f8a676be9343958b18526c8789912ba65 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Fri, 8 Mar 2024 00:15:49 +0100 Subject: [PATCH 17/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 2 +- .github/workflows/ligretto-deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index dad6c6ef..82446cbd 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -5,7 +5,7 @@ on: branches: - master push: - branches: [ master, 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud ] + branches: [ master ] paths: - 'apps/blog/**' - '.deploy/blog.deploy.yml' diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index 81148e6d..b6a54298 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -7,6 +7,7 @@ on: push: branches: - master + - 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud paths-ignore: - 'apps/gamehub-client/**' - 'apps/blog/**' @@ -15,7 +16,6 @@ on: - '.docker' - '!.docker/Ligretto*' - jobs: ligretto-frontend-build: From 0547cc0920a6daafb741f9ef9a8a547a8565e0fa Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Fri, 8 Mar 2024 01:03:49 +0100 Subject: [PATCH 18/26] [#475]: deploy to swarm action update --- .github/workflows/ligretto-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index b6a54298..3d33a595 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -144,6 +144,7 @@ jobs: with: path-to-stack: '.deploy/ligretto.deploy.yml' name: 'LIGRETTO' + sa_auth_key: ${{ secrets.YC_WORKER_KEY }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' @@ -152,7 +153,6 @@ jobs: name: Deploy to s3 with: path-to-folder: apps/ligretto-frontend/dist - sa_auth_key: ${{ secrets.YC_WORKER_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} bucket: 'lig-production-cdn-origin' From 6ded09d0052b509db1a8b32d1ce28aa82c27b73b Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Fri, 8 Mar 2024 01:08:55 +0100 Subject: [PATCH 19/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 2 +- .github/workflows/gamehub-deploy.yml | 1 + .github/workflows/ligretto-deploy.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index 82446cbd..e8c5b145 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -66,7 +66,7 @@ jobs: path-to-stack: '.deploy/blog.deploy.yml' name: 'BLOG' sa_auth_key: ${{ secrets.YC_WORKER_KEY }} - yc_folder_id: 'b1gomjd9naqavtbdh4rp' + yc_folder_id: ${{ env.YC_FOLDER_ID }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index ce8ad672..4a264dc0 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -64,6 +64,7 @@ jobs: with: path-to-stack: '.deploy/gamehub.deploy.yml' name: 'GAMEHUB' + yc_folder_id: ${{ env.YC_FOLDER_ID }} sa_auth_key: ${{ secrets.YC_WORKER_KEY }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index 3d33a595..9b0ab252 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -144,6 +144,7 @@ jobs: with: path-to-stack: '.deploy/ligretto.deploy.yml' name: 'LIGRETTO' + yc_folder_id: ${{ env.YC_FOLDER_ID }} sa_auth_key: ${{ secrets.YC_WORKER_KEY }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} From 3fbe67ffa641aa3f83df21b440380fb0d016ec66 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Fri, 8 Mar 2024 01:12:52 +0100 Subject: [PATCH 20/26] [#475]: deploy to swarm action update --- .github/workflows/blog-deploy.yml | 2 +- .github/workflows/gamehub-deploy.yml | 2 +- .github/workflows/ligretto-deploy.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/blog-deploy.yml b/.github/workflows/blog-deploy.yml index e8c5b145..f72fc736 100644 --- a/.github/workflows/blog-deploy.yml +++ b/.github/workflows/blog-deploy.yml @@ -66,7 +66,7 @@ jobs: path-to-stack: '.deploy/blog.deploy.yml' name: 'BLOG' sa_auth_key: ${{ secrets.YC_WORKER_KEY }} - yc_folder_id: ${{ env.YC_FOLDER_ID }} + yc_folder_id: ${{ vars.YC_FOLDER_ID }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} docker_registry: 'ghcr.io' diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index 4a264dc0..c36c4945 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -64,7 +64,7 @@ jobs: with: path-to-stack: '.deploy/gamehub.deploy.yml' name: 'GAMEHUB' - yc_folder_id: ${{ env.YC_FOLDER_ID }} + yc_folder_id: ${{ vars.YC_FOLDER_ID }} sa_auth_key: ${{ secrets.YC_WORKER_KEY }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index 9b0ab252..3b5cc001 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -144,7 +144,7 @@ jobs: with: path-to-stack: '.deploy/ligretto.deploy.yml' name: 'LIGRETTO' - yc_folder_id: ${{ env.YC_FOLDER_ID }} + yc_folder_id: ${{ vars.YC_FOLDER_ID }} sa_auth_key: ${{ secrets.YC_WORKER_KEY }} docker_registry_login: ${{ secrets.GHCR_USER }} docker_registry_password: ${{ secrets.GHCR_PULL_TOKEN }} From 9c857922953dba026ee4a62f73aae04f962e6792 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 10 Mar 2024 17:04:50 +0100 Subject: [PATCH 21/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-s3/action.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/actions/deploy-to-s3/action.yml b/.github/actions/deploy-to-s3/action.yml index 2d1d20f3..cd6fd83a 100644 --- a/.github/actions/deploy-to-s3/action.yml +++ b/.github/actions/deploy-to-s3/action.yml @@ -19,17 +19,26 @@ inputs: AWS_REGION: required: false description: 'AWS region' - default: 'eu-north-1' + default: 'ru-central1' runs: using: "composite" steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1-node16 - with: - aws-access-key-id: ${{ inputs.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ inputs.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ inputs.AWS_REGION }} + - name: Configure AWS + shell: 'bash' + run: | + mkdir .aws + cat << 'EOF' > .aws/credentials + [default] + aws_access_key_id = ${{ inputs.AWS_ACCESS_KEY_ID }} + aws_secret_access_key = ${{ inputs.AWS_SECRET_ACCESS_KEY }} + endpoint_url = https://storage.yandexcloud.net + EOF + + cat << 'EOF' > .aws/config + [default] + region = ${{ inputs.AWS_REGION }} + EOF - name: Upload frontend build to s3 shell: 'bash' From 1db0e4f38d34059086dd27a98fde1112baba31db Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 10 Mar 2024 17:15:33 +0100 Subject: [PATCH 22/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-s3/action.yml | 6 ------ .github/workflows/ligretto-deploy.yml | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/actions/deploy-to-s3/action.yml b/.github/actions/deploy-to-s3/action.yml index cd6fd83a..7423af40 100644 --- a/.github/actions/deploy-to-s3/action.yml +++ b/.github/actions/deploy-to-s3/action.yml @@ -13,9 +13,6 @@ inputs: bucket: required: true description: 's3 bucket to sync' - backup-bucket: - required: true - description: 's3 bucket to backup' AWS_REGION: required: false description: 'AWS region' @@ -44,8 +41,5 @@ runs: shell: 'bash' env: PROD_CLIENT_APP_S3_BUCKET: ${{ inputs.bucket }} - PROD_CLIENT_APP_S3_BUCKET_BACKUP: ${{ inputs.backup-bucket }} run: | - aws s3 sync s3://$PROD_CLIENT_APP_S3_BUCKET s3://$PROD_CLIENT_APP_S3_BUCKET_BACKUP --delete - aws s3 cp s3://$PROD_CLIENT_APP_S3_BUCKET/index.html s3://$PROD_CLIENT_APP_S3_BUCKET_BACKUP/index.html # aws s3 sync cant correctly invalidate index.html file aws s3 sync ${{ inputs.path-to-folder }} s3://$PROD_CLIENT_APP_S3_BUCKET --delete diff --git a/.github/workflows/ligretto-deploy.yml b/.github/workflows/ligretto-deploy.yml index 3b5cc001..8407b382 100644 --- a/.github/workflows/ligretto-deploy.yml +++ b/.github/workflows/ligretto-deploy.yml @@ -156,6 +156,5 @@ jobs: path-to-folder: apps/ligretto-frontend/dist AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - bucket: 'lig-production-cdn-origin' - backup-bucket: 'lig-production-cdn-backup' + bucket: 'ligretto.app' From 0bf55427127e12fc3d67b565fc52506b6aab73c0 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 10 Mar 2024 17:27:27 +0100 Subject: [PATCH 23/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-s3/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/deploy-to-s3/action.yml b/.github/actions/deploy-to-s3/action.yml index 7423af40..41e87d34 100644 --- a/.github/actions/deploy-to-s3/action.yml +++ b/.github/actions/deploy-to-s3/action.yml @@ -25,14 +25,15 @@ runs: shell: 'bash' run: | mkdir .aws - cat << 'EOF' > .aws/credentials + aws --version + cat << 'EOF' > ~/.aws/credentials [default] aws_access_key_id = ${{ inputs.AWS_ACCESS_KEY_ID }} aws_secret_access_key = ${{ inputs.AWS_SECRET_ACCESS_KEY }} endpoint_url = https://storage.yandexcloud.net EOF - cat << 'EOF' > .aws/config + cat << 'EOF' > ~/.aws/config [default] region = ${{ inputs.AWS_REGION }} EOF From 55af5ae5aa06ef4afd8f40aa23ea61b6d2e34fd1 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 10 Mar 2024 17:29:42 +0100 Subject: [PATCH 24/26] [#475]: deploy to swarm action update --- .github/actions/deploy-to-s3/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/deploy-to-s3/action.yml b/.github/actions/deploy-to-s3/action.yml index 41e87d34..1b0bcf58 100644 --- a/.github/actions/deploy-to-s3/action.yml +++ b/.github/actions/deploy-to-s3/action.yml @@ -24,8 +24,7 @@ runs: - name: Configure AWS shell: 'bash' run: | - mkdir .aws - aws --version + mkdir ~/.aws cat << 'EOF' > ~/.aws/credentials [default] aws_access_key_id = ${{ inputs.AWS_ACCESS_KEY_ID }} From e8f7fd5fcb3614f6a765ee55eb190468651be39d Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sat, 16 Mar 2024 23:12:40 +0100 Subject: [PATCH 25/26] deploy to yc --- .github/workflows/gamehub-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index c36c4945..e2433560 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -4,6 +4,7 @@ on: workflow_dispatch: branches: - master + - 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud push: branches: [ master ] paths: From c49b84fe7e7b6eaff02d24d0edf18cdff46f64b2 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sat, 16 Mar 2024 23:14:02 +0100 Subject: [PATCH 26/26] deploy to yc --- .github/workflows/gamehub-deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/gamehub-deploy.yml b/.github/workflows/gamehub-deploy.yml index e2433560..eae409f8 100644 --- a/.github/workflows/gamehub-deploy.yml +++ b/.github/workflows/gamehub-deploy.yml @@ -4,16 +4,14 @@ on: workflow_dispatch: branches: - master - - 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud push: - branches: [ master ] + branches: [ master, 475-modify-deploy-to-swarm-action-to-use-with-yandex-cloud ] paths: - 'apps/gamehub-client/**' - '.deploy/gamehub.deploy.yml' - '.docker/GameHub-client_Dockerfile*' - '.github/workflows/gamehub-deploy.yml' - jobs: build-gamehub-client-image: