fix: add .catch() to fire-and-forget setMeta and track error fingerpr… #1577
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
| on: | |
| push: | |
| branches: | |
| - master | |
| name: Deploy test instance and Docker image | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Deploy Demo App | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install SSH key | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_KEY }} | |
| known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
| - name: Deploy to server | |
| env: | |
| TARGET_HOST_02: dev.emailengine.app | |
| NODE_ENV: production | |
| SERVICE_NAME: emailengine | |
| id: deploy | |
| run: | | |
| echo $GITHUB_SHA > commit.txt | |
| ./update-info.sh | |
| npm install --omit=dev | |
| tar czf /tmp/${SERVICE_NAME}.tar.gz --exclude .git . | |
| scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" /tmp/${SERVICE_NAME}.tar.gz deploy@${TARGET_HOST_02}: | |
| ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" deploy@$TARGET_HOST_02 "/opt/deploy.sh ${SERVICE_NAME}" | |
| - name: Deploy to demo server | |
| env: | |
| TARGET_HOST_02: dev.emailengine.app | |
| NODE_ENV: production | |
| SERVICE_NAME: emailengine-demo | |
| id: deploy-demo | |
| run: | | |
| echo $GITHUB_SHA > commit.txt | |
| ./update-info.sh | |
| npm install --omit=dev | |
| tar czf /tmp/${SERVICE_NAME}.tar.gz --exclude .git . | |
| scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" /tmp/${SERVICE_NAME}.tar.gz deploy@${TARGET_HOST_02}: | |
| ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" deploy@$TARGET_HOST_02 "/opt/deploy.sh ${SERVICE_NAME}" | |
| docker: | |
| name: Build Docker Image | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: 'arm64,arm' | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| platforms: linux/amd64,linux/arm64/v8 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ github.repository }} | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=latest,enable=true | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: ${{ steps.buildx.outputs.platforms }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |