diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 8d19bf96..d2dd2293 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -106,24 +106,29 @@ jobs: airflow_conn_pg = TF_OUTPUTS["airflow_conn_pg"]["value"] public_ip = TF_OUTPUTS["public_ip"]["value"] + print(f"::add-mask::{airflow_conn_s3}") print(f"AIRFLOW_CONN_S3={airflow_conn_s3}") + print(f"::add-mask::{airflow_conn_pg}") print(f"AIRFLOW_CONN_PG={airflow_conn_pg}") print(f"SERVER_PUBLIC_IP={public_ip}") EOF - )" "${TF_OUTPUTS}" >> "${GITHUB_ENV}" + )" "${TF_OUTPUTS}" >> "${GITHUB_OUTPUT}" - name: set up ssh agent env: - SERVER_PUBLIC_IP: ${{ env.server_public_ip }} - SSH_AUTH_SOCK: /tmp/ssh_agent.sock + SERVER_PUBLIC_IP: ${{ steps.set-outputs.outputs.server_public_ip }} SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} run: | - mkdir -p /home/runner/.ssh - ssh-keyscan "${SERVER_PUBLIC_IP}" >> /home/runner/.ssh/known_hosts - echo "${SSH_PRIVATE_KEY}" >> /home/runner/.ssh/key - chmod 600 /home/runner/.ssh/key - ssh-agent -a "${SSH_AUTH_SOCK}" > /dev/null - ssh-add /home/runner/.ssh/key + mkdir -p ~/.ssh + echo "${SSH_PRIVATE_KEY}" >> ~/.ssh/key + chmod 600 ~/.ssh/key + cat >> ~/.ssh/config << EOF + Host staging + HostName "${SERVER_PUBLIC_IP}" + User root + IdentityFile ~/.ssh/key + StrictHostKeyChecking no + EOF # - name: start services # env: