diff --git a/.github/workflows/build_deploy_backend.yml b/.github/workflows/build_deploy_backend.yml index 170cd753..5e2925a5 100644 --- a/.github/workflows/build_deploy_backend.yml +++ b/.github/workflows/build_deploy_backend.yml @@ -24,7 +24,7 @@ jobs: - name: Build and push ${{ matrix.service }} uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} token: ${{ secrets.DOCKERHUB_TOKEN }} context: ./zubhub_backend/ file: ./zubhub_backend/compose/${{ matrix.service }}/prod/Dockerfile @@ -40,16 +40,16 @@ jobs: - uses: unstructuredstudio/zubhub/.github/actions/scp_action@master with: - host: ${{ secrets.DO_BACKEND_HOST }} - username: ${{ secrets.DO_BACKEND_USERNAME }} + host: ${{ vars.DO_BACKEND_HOST }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} source: "." target: "/home/zubhub-services/zubhub" - uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: - host: ${{ secrets.DO_BACKEND_HOST }} - username: ${{ secrets.DO_BACKEND_USERNAME }} + host: ${{ vars.DO_BACKEND_HOST }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} script: | cp /home/zubhub-services/zubhub/zubhub_backend/compose/deploy_backend.sh /home/zubhub-services/ @@ -90,7 +90,7 @@ jobs: uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: host: ${{ matrix.host }} - username: ${{ secrets.DO_BACKEND_USERNAME }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} script: | diff --git a/.github/workflows/build_deploy_frontend.yml b/.github/workflows/build_deploy_frontend.yml index 2ed18aec..de028cd0 100644 --- a/.github/workflows/build_deploy_frontend.yml +++ b/.github/workflows/build_deploy_frontend.yml @@ -21,7 +21,7 @@ jobs: - name: Build and push frontend uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} token: ${{ secrets.DOCKERHUB_TOKEN }} context: ./zubhub_frontend/zubhub/ file: ./zubhub_frontend/zubhub/Dockerfile.prod @@ -37,16 +37,16 @@ jobs: - uses: unstructuredstudio/zubhub/.github/actions/scp_action@master with: - host: ${{ secrets.DO_BACKEND_HOST }} - username: ${{ secrets.DO_BACKEND_USERNAME }} + host: ${{ vars.DO_BACKEND_HOST }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} source: "." target: "/home/zubhub-frontend/zubhub" - uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: - host: ${{ secrets.DO_FRONTEND_HOST }} - username: ${{ secrets.DO_FRONTEND_USERNAME }} + host: ${{ vars.DO_FRONTEND_HOST }} + username: ${{ vars.DO_FRONTEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} script: | cp /home/zubhub-frontend/zubhub/zubhub_frontend/zubhub/deploy_frontend.sh /home/zubhub-frontend/ @@ -59,8 +59,8 @@ jobs: - name: Execute docker system prune on frontend host uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: - host: ${{ secrets.DO_FRONTEND_HOST }} - username: ${{ secrets.DO_FRONTEND_USERNAME }} + host: ${{ vars.DO_FRONTEND_HOST }} + username: ${{ vars.DO_FRONTEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} script: | diff --git a/.github/workflows/create_destroy_test_vm.yaml b/.github/workflows/create_destroy_test_vm.yaml index 4793e18c..da79d484 100644 --- a/.github/workflows/create_destroy_test_vm.yaml +++ b/.github/workflows/create_destroy_test_vm.yaml @@ -112,7 +112,7 @@ jobs: NEW_DROPLET_IP: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).NEW_DROPLET_IP }} with: host: ${{env.NEW_DROPLET_IP}} - username: ${{ secrets.DO_BACKEND_USERNAME }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} source: "." target: "/home/zubhub" @@ -196,7 +196,7 @@ jobs: - name: Build and push ${{ matrix.service }} uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} token: ${{ secrets.DOCKERHUB_TOKEN }} # for frontend, context is ./zubhub_frontend/zubhub/ # for backend services, context is ./zubhub_backend/ @@ -229,7 +229,7 @@ jobs: uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: host: ${{env.NEW_DROPLET_IP}} - username: ${{ secrets.DO_BACKEND_USERNAME }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} script: | diff --git a/.github/workflows/locust.yml b/.github/workflows/locust.yml index 0d5da4a0..53fdc8bd 100644 --- a/.github/workflows/locust.yml +++ b/.github/workflows/locust.yml @@ -27,7 +27,7 @@ jobs: - name: Build and push locust uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} token: ${{ secrets.DOCKERHUB_TOKEN }} context: ./locust/ file: ./locust/Dockerfile @@ -62,7 +62,7 @@ jobs: NEW_DROPLET_IP: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).NEW_DROPLET_IP }} with: host: ${{ env.NEW_DROPLET_IP }} - username: ${{ secrets.DO_BACKEND_USERNAME }} + username: ${{ vars.DO_BACKEND_USERNAME }} key: ${{ secrets.DO_SSHKEY }} script: | docker run -d -p 8089:8089 unstructuredstudio/zubhub-services_locust:latest \ diff --git a/.github/workflows/scale_backend.yml b/.github/workflows/scale_backend.yml index 982a0bbf..712f2ef8 100644 --- a/.github/workflows/scale_backend.yml +++ b/.github/workflows/scale_backend.yml @@ -40,7 +40,7 @@ jobs: NEW_DROPLET_IP: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).NEW_DROPLET_IP }} with: HOST: ${{ env.NEW_DROPLET_IP }} - USERNAME: ${{ secrets.DO_BACKEND_USERNAME }} + USERNAME: ${{ vars.DO_BACKEND_USERNAME }} KEY: ${{ secrets.DO_SSHKEY }} script: "docker swarm join --token ${{secrets.SWARM_WORKER_JOIN_TOKEN}} ${{secrets.SWARM_MASTER_HOST_AND_PORT}};sleep 10" @@ -49,8 +49,8 @@ jobs: env: TARGET_DROPLETS_COUNT: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).TARGET_DROPLETS_COUNT }} with: - HOST: ${{ secrets.DO_BACKEND_HOST }} - USERNAME: ${{ secrets.DO_BACKEND_USERNAME }} + HOST: ${{ vars.DO_BACKEND_HOST }} + USERNAME: ${{ vars.DO_BACKEND_USERNAME KEY: ${{ secrets.DO_SSHKEY }} script: "docker service scale zubhub-services_web=${{env.TARGET_DROPLETS_COUNT}}" @@ -81,8 +81,8 @@ jobs: if: ${{ env.TARGET_DROPLETS_COUNT > 0 }} uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: - HOST: ${{ secrets.DO_BACKEND_HOST }} - USERNAME: ${{ secrets.DO_BACKEND_USERNAME }} + HOST: ${{ vars.DO_BACKEND_HOST }} + USERNAME: ${{ vars.DO_BACKEND_USERNAME }} KEY: ${{ secrets.DO_SSHKEY }} script: "docker service scale zubhub-services_web=${{env.TARGET_DROPLETS_COUNT}}" @@ -94,7 +94,7 @@ jobs: uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: HOST: ${{ env.TARGET_DROPLET_IP }} - USERNAME: ${{ secrets.DO_BACKEND_USERNAME }} + USERNAME: ${{ vars.DO_BACKEND_USERNAME }} KEY: ${{ secrets.DO_SSHKEY }} script: "docker swarm leave;sleep 5s" @@ -115,7 +115,7 @@ jobs: if: ${{ env.TARGET_DROPLETS_COUNT > 0 }} uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master with: - HOST: ${{ secrets.DO_BACKEND_HOST }} - USERNAME: ${{ secrets.DO_BACKEND_USERNAME }} + HOST: ${{ vars.DO_BACKEND_HOST }} + USERNAME: ${{ vars.DO_BACKEND_USERNAME }} KEY: ${{ secrets.DO_SSHKEY }} script: "docker node rm zubhub-services-${{env.TARGET_DROPLETS_COUNT}}"