Writing .Renviron file in GitHub Actions Step for rsconnect Shinyapps build

Hi, I'm finishing up working on some CI/CD stuff for a Shiny app of mine. I'm using GitHub actions to build & deploy my app to shinyapps anytime I push code to the master branch. Everything works, but I have a remote DB i want to connect to and I need to store some credentials in a .Renviron file. Obviously I don't want that just hanging around in a git repo, so I thought I could store all of the actual credentials with GitHub secrets and then write the .Renviron file in the GitHub Actions yaml script by referencing the secrets.

I believe this idea can work, but i don't think the .Renviron file is ever in the right directory? So when I call rsconnect to build & deploy the app it never has a .Renviron file there in the first place, and then my Shiny app doesn't have any of those env variables.

Below is my code, the step I'm having difficulty on is the create and populate .Renviron file.

on: [push, pull_request]
name: CI-CD
    runs-on: ${{ matrix.config.os }}

    name: ${{ matrix.config.os }} (${{ matrix.config.r }})

          - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

      # Enable RStudio Package Manager to speed up package installation
      RSPM: ${{ matrix.config.rspm }}
      # Access token for GitHub
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}


      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Setup R
        uses: r-lib/actions/setup-r@v1
          r-version: ${{ matrix.config.r }}

      - name: Install system dependencies
        run: |
          while read -r cmd
            eval sudo $cmd
          done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
      - name: Install R dependencies
        run: |
          remotes::install_deps(dependencies = TRUE)
        shell: Rscript {0}

      - name: Create and populate .Renviron file
          AWS_HOST: ${{ secrets.AWS_HOST }}
          AWS_PORT: ${{ secrets.AWS_PORT }}
          AWS_PW: ${{ secrets.AWS_PW }}
          AWS_USER: ${{ secrets.AWS_USER }}
          DBNAME: ${{ secrets.DBNAME }}
        run: |
          touch .Renviron
          echo aws_host="$AWS_HOST" >> .Renviron
          echo aws_port="$AWS_PORT" >> .Renviron
          echo aws_pw="$AWS_PW" >> .Renviron
          echo aws_user="$AWS_USER" >> .Renviron
          echo dbname="$DBNAME" >> .Renviron
          ls ${{ github.workspace }}
        shell: bash

      - name: Deploy to shinyapps.io
        # continuous deployment only for pushes to the main / master branch
        if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
          SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }}
        run: Rscript deploy/deploy-shinyapps.R

I've tried a whole bunch of file paths and I always run ls {{ github.workspace }} afterwards to check if the .Renviron got written there because that's where I want it saved to, but it never gets listed. I'm not sure if i'm screwing up the file paths, or if it's getting saved somewhere else, or maybe it's not persisting for some reason? I thought gitignore was interfering but it doesn't appear so. If anyone has any ideas I'd appreciate it!