Merge pull request #5 from techdivision/develop #6
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 Staging | |
| on: | |
| push: | |
| branches: | |
| - staging | |
| jobs: | |
| deploy-staging: | |
| name: Deploy to Staging Environment | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: staging | |
| url: https://staging.example.com | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Run build | |
| run: npm run build | |
| - name: Deploy to Staging | |
| run: | | |
| echo "Deploying to Staging environment..." | |
| # Add your staging deployment commands here | |
| # Examples: | |
| # - npm publish --tag staging | |
| # - Deploy to staging server | |
| # - Deploy to staging cloud environment | |
| env: | |
| # Add your staging environment secrets here | |
| STAGING_TOKEN: ${{ secrets.STAGING_TOKEN }} | |
| - name: Notify deployment | |
| if: success() | |
| run: | | |
| echo "✅ Successfully deployed to Staging" | |
| echo "Branch: ${{ github.ref_name }}" | |
| echo "Commit: ${{ github.sha }}" | |
| - name: Notify failure | |
| if: failure() | |
| run: | | |
| echo "❌ Staging deployment failed" | |
| echo "Check logs for details" |