feat: alfagift order done transaction and cart (#801) #315
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 GetGather All | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| name: Deploy GetGather All | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 10 | |
| env: | |
| GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
| steps: | |
| - name: Check out source repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Show 5 most recent commits | |
| run: git log --oneline -n 5 | |
| - name: Tailscale | |
| uses: tailscale/github-action@v3 | |
| with: | |
| oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
| oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
| tags: tag:ci | |
| use-cache: true | |
| - name: Show Tailnet IP address | |
| run: tailscale ip | |
| - name: Configure Google Cloud | |
| uses: ./.github/actions/gcp-setup | |
| with: | |
| credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} | |
| - id: fetch_secrets | |
| name: Fetch deployment secrets | |
| uses: google-github-actions/get-secretmanager-secrets@v3 | |
| with: | |
| secrets: |- | |
| DOKKU_GIT_REMOTE_URL:${{ env.GCP_PROJECT_ID }}/dokku-git-remote-url-getgather-all | |
| DOKKU_SSH_HOST_KEY:${{ env.GCP_PROJECT_ID }}/dokku-ssh-host-key-getgather-all | |
| DOKKU_SSH_PRIVATE_KEY:${{ env.GCP_PROJECT_ID }}/dokku-ssh-private-key-getgather-all | |
| TAILSCALE_APP_URL:${{ env.GCP_PROJECT_ID }}/tailscale-app-url-getgather-all | |
| - name: Check the reachability of the app server | |
| env: | |
| APP_URL: ${{ steps.fetch_secrets.outputs.TAILSCALE_APP_URL }} | |
| run: | | |
| echo "Target: getgather-all" | |
| curl -s "${APP_URL}/health" | |
| continue-on-error: true | |
| - name: Deploy to GCE via dokku | |
| uses: dokku/github-action@master | |
| with: | |
| trace: 1 | |
| branch: main | |
| git_push_flags: --force | |
| git_remote_url: ${{ steps.fetch_secrets.outputs.DOKKU_GIT_REMOTE_URL }} | |
| ssh_host_key: ${{ steps.fetch_secrets.outputs.DOKKU_SSH_HOST_KEY }} | |
| ssh_private_key: ${{ steps.fetch_secrets.outputs.DOKKU_SSH_PRIVATE_KEY }} | |
| - name: Verify deployment via health endpoint | |
| env: | |
| APP_URL: ${{ steps.fetch_secrets.outputs.TAILSCALE_APP_URL }} | |
| run: |- | |
| LOCAL_COMMIT=$(git rev-parse HEAD) | |
| echo "Target: getgather-all" | |
| echo "Local commit: $LOCAL_COMMIT" | |
| echo "App URL: $APP_URL" | |
| # Check health endpoint and extract git revision | |
| HEALTH_RESPONSE=$(curl -s "${APP_URL}/health" || echo "FAILED") | |
| echo "Health response: $HEALTH_RESPONSE" | |
| if [[ "$HEALTH_RESPONSE" == "FAILED" ]]; then | |
| echo "Error: Health endpoint is not accessible" | |
| exit 1 | |
| fi | |
| # Extract git revision from health response (format: "OK <timestamp> GIT_REV: <commit>") | |
| REMOTE_COMMIT=$(echo "$HEALTH_RESPONSE" | grep -o "GIT_REV: [a-f0-9]*" | cut -d' ' -f2) | |
| echo "Remote commit: $REMOTE_COMMIT" | |
| if [ "$LOCAL_COMMIT" != "$REMOTE_COMMIT" ]; then | |
| echo "Error: Local and remote commits do not match" | |
| exit 1 | |
| fi | |
| echo "✅ Deployment and health endpoint verified successfully" |