add note about develop to readme #4
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: Staging Release | |
| concurrency: staging-release | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build: | |
| name: Build and Deploy to Staging | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: make all | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| NEXT_PUBLIC_URL: https://${{ secrets.STAGING_HOSTNAME }}/ | |
| DENY_ROBOTS_TXT: "1" | |
| - name: Deploy to the staging bucket | |
| run: cd deployment && npm ci && npm run start | |
| env: | |
| DEPLOYMENT_CF_BUCKET: ${{ secrets.STAGING_CF_BUCKET }} | |
| DEPLOYMENT_CF_ACCOUNT_ID: ${{ secrets.DEPLOYMENT_CF_ACCOUNT_ID }} | |
| DEPLOYMENT_CF_AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_CF_AWS_ACCESS_KEY_ID }} | |
| DEPLOYMENT_CF_AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_CF_AWS_SECRET_ACCESS_KEY }} | |
| - uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.DEPLOYMENT_CF_ACCOUNT_ID }} | |
| environment: staging | |
| wranglerVersion: "4.15.0" | |
| - name: Clear cloudflare cache | |
| run: | | |
| curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.STAGING_CF_ZONE_ID }}/purge_cache" \ | |
| -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| --data '{"hosts":["${{ secrets.STAGING_HOSTNAME }}"]}' | |
| - name: Success Slack Notify | |
| if: ${{ success() }} | |
| uses: slackapi/[email protected] | |
| with: | |
| payload: '{"blocks":[{"type":"section","text":{"type":"mrkdwn","text":":rocket: **${{ env.SERVICE }}** deployed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}]}' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
| SERVICE: ec2instances-staging | |
| - name: Failure Slack Notify | |
| if: ${{ failure() }} | |
| uses: slackapi/[email protected] | |
| with: | |
| payload: '{"blocks":[{"type":"section","text":{"type":"mrkdwn","text":":see_no_evil: **${{ env.SERVICE }}** wasn''t deployed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}}]}' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
| SERVICE: ec2instances-staging |