Adjust timeout time #3
This file contains hidden or 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 Lightsail | |
| on: | |
| push: | |
| branches: | |
| - prod | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Create .env file | |
| run: echo "${{ secrets.ENV_TEXT }}" > .env | |
| - name: Build app | |
| run: bun run build | |
| - name: Build Docker image | |
| run: docker build -t global-calendar:latest . | |
| - name: Save Docker image | |
| run: docker save global-calendar:latest | gzip > global-calendar.tar.gz | |
| - name: Copy files to server | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USERNAME }} | |
| key: ${{ secrets.SSH_KEY }} | |
| source: global-calendar.tar.gz,compose.yml,.env | |
| target: ~/global-calendar | |
| timeout: 600s | |
| - name: Deploy | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USERNAME }} | |
| key: ${{ secrets.SSH_KEY }} | |
| script: | | |
| cd ~/global-calendar | |
| docker load < global-calendar.tar.gz | |
| docker compose down || true | |
| docker compose up -d | |
| rm global-calendar.tar.gz |