gpt suggestions #12
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- run: pnpm install | |
- run: pnpm -r run build | |
- name: Verify Build Output | |
run: ls -la ./apps/next-auth/dist/ && ls -la ./apps/teste/dist/ | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
app: | |
- name: 'next-auth' | |
path: 'apps/next-auth/dist/' | |
remote_path: '/var/www/guias/next-auth/' | |
- name: 'teste' | |
path: 'apps/teste/dist/' | |
remote_path: '/var/www/guias/teste/' | |
# Add more apps as needed | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Print working directory and list files | |
run: | | |
echo "Working directory:" | |
pwd | |
echo "Content of repository root:" | |
ls -la | |
- name: Print matrix app path and list files in it | |
run: | | |
echo "Matrix app path: ${{ matrix.app.path }}" | |
echo "Contents of the path:" | |
ls -la ${{ matrix.app.path }} | |
- name: Deploy with rsync | |
uses: burnett01/[email protected] | |
with: | |
switches: -avzr --quiet --delete | |
path: ${{ matrix.app.path }} | |
remote_path: ${{ matrix.app.remote_path }} | |
remote_host: ${{ secrets.HOST }} | |
remote_user: ${{ secrets.USERNAME }} | |
remote_key: ${{ secrets.SSH_KEY }} |