From dc53b53800d82d7d8cab8d53e7ae1aa52ec3d38f Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Mon, 18 Dec 2023 16:33:04 +0200 Subject: [PATCH] make a 1-1 mapping to github environments and deployed environments. Demo should have its own Github environment and not use production --- .github/workflows/deploy-prod.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index cfc4076d4..29363ed22 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -1,4 +1,4 @@ -name: Deploy(production) +name: Deploy (production) run-name: Deploy to ${{ github.event.inputs.environment }} core=${{ github.event.inputs.core-image-tag }} country config=${{ github.event.inputs.countryconfig-image-tag }} on: workflow_dispatch: @@ -7,9 +7,10 @@ on: type: choice description: Environment to deploy to required: true - default: 'production' + default: 'staging' options: - production + - staging core-image-tag: description: Core DockerHub image tag required: true @@ -17,14 +18,7 @@ on: countryconfig-image-tag: description: Your Country Config DockerHub image tag required: true - deploy-script-environment: - type: choice - description: Deploy script environment - required: true - default: 'production' - options: - - production - - demo + jobs: deploy: environment: ${{ github.event.inputs.environment }} @@ -68,12 +62,6 @@ jobs: key: ${{ secrets.SSH_KEY }} known_hosts: ${{ env.KNOWN_HOSTS }} - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Wait for images to be available run: | while true; do @@ -121,7 +109,7 @@ jobs: cd ./${{ github.event.repository.name }} yarn deploy \ --clear_data=no \ - --environment=${{ github.event.inputs.deploy-script-environment }} \ + --environment=${{ github.event.inputs.environment }} \ --host=${{ env.DOMAIN }} \ --ssh_host=${{ secrets.SSH_HOST }} \ --ssh_user=${{ secrets.SSH_USER }} \