Update deploy.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Production Server | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: 'ISV2 deployment' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up SSH connection | |
uses: webfactory/ssh-agent@v0.5.3 | |
with: | |
ssh-private-key: ${{ secrets.TEMP_SERVER_SSH_PRIVATE_KEY }} | |
- name: Connect and deploy | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ vars.TEMP_SERVER_USER }}@${{ vars.TEMP_SERVER_ADDRESS }} << 'EOF' | |
cd auth-cyb | |
cat <<EOT > .env.test | |
DATABASE_URL = 'mysql://${{ secrets.DATABASE_USER }}:${{ secrets.DATABASE_PASSWORD }}@localhost:3306/${{ secrets.DATABASE_NAME }}' | |
NEXTAUTH_URL = '${{ vars.NEXTAUTH_URL }}' | |
NEXTAUTH_CALLBACK = '${{ secrets.NEXTAUTH_URL }}/pages/home' | |
NEXTAUTH_SECRET = '${{ secrets.NEXTAUTH_SECRET }}' | |
NEXTAUTH_GITHUB_CLIENT_ID = '${{ vars.NEXTAUTH_GITHUB_CLIENT_ID }}' | |
NEXTAUTH_GITHUB_CLIENT_SECRET = '${{ secrets.NEXTAUTH_GITHUB_CLIENT_SECRET }}' | |
NEXT_PUBLIC_SANITY_API_VERSION = '${{ vars.NEXT_PUBLIC_SANITY_API_VERSION }}' | |
NEXT_PUBLIC_SANITY_DATASET = '${{ vars.NEXT_PUBLIC_SANITY_DATASET }}' | |
NEXT_PUBLIC_SANITY_PROJECT_ID = '${{ vars.NEXT_PUBLIC_SANITY_PROJECT_ID }}' | |
EOT | |
EOF |