Skip to content

chore: delete old usage tracking / capping #13791

chore: delete old usage tracking / capping

chore: delete old usage tracking / capping #13791

Workflow file for this run

name: '[Release] Build unified Docker image'
on:
push:
branches:
- master
- staging/**
pull_request:
merge_group:
jobs:
should-run:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.check.outputs.should_skip }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docs_only:
- 'docs/**'
non_docs:
- '**'
- '!docs/**'
- name: Determine if should skip
id: check
run: |
# Run on PRs only if not docs only
# Always run on merge queue
# Always run on direct pushes to master (not merge queue bot)
IS_PR="${{ github.event_name == 'pull_request' }}"
IS_MERGE_QUEUE="${{ github.event_name == 'merge_group' }}"
IS_DIRECT_PUSH_TO_MASTER="${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor != 'github-merge-queue[bot]' }}"
IS_DOCS_ONLY="${{ steps.filter.outputs.docs_only == 'true' && steps.filter.outputs.non_docs != 'true' }}"
SHOULD_SKIP="true"
# Always run on merge queue and direct push to master
if [[ "$IS_MERGE_QUEUE" == "true" || "$IS_DIRECT_PUSH_TO_MASTER" == "true" ]]; then
SHOULD_SKIP="false"
# Run on PR only if not docs only
elif [[ "$IS_PR" == "true" && "$IS_DOCS_ONLY" != "true" ]]; then
SHOULD_SKIP="false"
fi
echo "should_skip=$SHOULD_SKIP" >> $GITHUB_OUTPUT
build-image:
needs: should-run
runs-on: ubuntu-latest
env:
CAN_PUSH: "${{ secrets.DOCKER_PASSWORD != '' && secrets.DOCKER_USERNAME != '' }}"
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Check out
if: needs.should-run.outputs.should_skip != 'true'
uses: actions/checkout@v4
- name: Set up QEMU
if: needs.should-run.outputs.should_skip != 'true'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: needs.should-run.outputs.should_skip != 'true'
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
if: needs.should-run.outputs.should_skip != 'true' && env.CAN_PUSH == 'true'
with:
username: '${{ secrets.DOCKER_USERNAME }}'
password: '${{ secrets.DOCKER_PASSWORD }}'
# Needed for buildx gha cache to work
- name: Expose GitHub Runtime
if: needs.should-run.outputs.should_skip != 'true'
uses: crazy-max/ghaction-github-runtime@v2
- name: Build image
if: needs.should-run.outputs.should_skip != 'true'
run: |
./scripts/build_docker.sh build ${{ env.SHA }}
- name: Push image
if: needs.should-run.outputs.should_skip != 'true' && env.CAN_PUSH == 'true'
run: |
docker push nangohq/nango:${{ env.SHA }}
- name: (self-hosted) Build and push
if: needs.should-run.outputs.should_skip != 'true'
run: |
./scripts/build_docker_self_hosted.sh ${{ env.SHA }} ${{ env.CAN_PUSH }}