feat: better external link validation #2719
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: daedalus-docker-build | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| paths: | |
| - .github/workflows/daedalus-docker.yml | |
| - 'apps/daedalus_client/**' | |
| - 'packages/daedalus/**' | |
| - Cargo.toml | |
| - Cargo.lock | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - .github/workflows/daedalus-docker.yml | |
| - 'apps/daedalus_client/**' | |
| - 'packages/daedalus/**' | |
| - Cargo.toml | |
| - Cargo.lock | |
| merge_group: | |
| types: [checks_requested] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/prod' }} | |
| jobs: | |
| skip-if-clean: | |
| name: Skip if merge_queue produces no diff | |
| runs-on: ubuntu-latest | |
| outputs: | |
| skip: ${{ steps.check.outputs.skip }} | |
| internal: ${{ steps.check-internal.outputs.internal }} | |
| if: ${{ always() }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Check if workflow runs on an internal branch | |
| id: check-internal | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| if [ "$EVENT_NAME" != "pull_request" ] || [ "$HEAD_REPO" = "$REPO" ]; then | |
| echo "internal=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "internal=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Merge Queue CI Check Skipper | |
| id: merge-queue-ci-skipper | |
| uses: ./.github/merge-queue-ci-skipper | |
| with: | |
| secret: ${{ secrets.GH_ACCESS_TOKEN }} | |
| - name: Check merge_group synthetic commit | |
| id: check | |
| run: | | |
| # PR mode: never skip | |
| if [ "${{ github.event_name }}" != "merge_group" ]; then | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| if [ "${{ steps.merge-queue-ci-skipper.outputs.skip-check }}" = "true" ]; then | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| fi | |
| build: | |
| name: Build daedalus_client | |
| runs-on: ${{ needs.skip-if-clean.outputs.internal == 'true' && 'namespace-profile-medium-amd64' || 'ubuntu-latest' }} | |
| needs: [skip-if-clean] | |
| if: ${{ needs.skip-if-clean.outputs.skip != 'true' }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 | |
| with: | |
| rustflags: '' | |
| cache: false | |
| - name: Setup mold | |
| uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1 / Mold 2.41.0 | |
| - name: Build daedalus_client | |
| run: cargo build --release --package daedalus_client | |
| - name: Stage Docker context | |
| run: | | |
| mkdir -p apps/daedalus_client/docker-stage | |
| cp target/release/daedalus_client apps/daedalus_client/docker-stage/daedalus_client | |
| - name: Upload Docker context | |
| if: needs.skip-if-clean.outputs.internal == 'true' | |
| uses: namespace-actions/upload-artifact@f6ccaacc655aec41b93af180d1d7eef21af862d2 # v1.0.3 | |
| with: | |
| name: daedalus-docker-context | |
| retention-days: 1 | |
| path: apps/daedalus_client/docker-stage | |
| docker-build: | |
| needs: [skip-if-clean, build] | |
| if: ${{ needs.skip-if-clean.outputs.internal == 'true' }} | |
| uses: SparkUniverse/workflows/.github/workflows/docker-build.yaml@main | |
| with: | |
| image-name: daedalus | |
| dockerfile-path: apps/daedalus_client/Dockerfile | |
| artifacts-name: daedalus-docker-context | |
| deploy: | |
| needs: [skip-if-clean, docker-build] | |
| if: ${{ needs.skip-if-clean.outputs.internal == 'true' && github.ref == 'refs/heads/prod' && github.event_name == 'push' }} | |
| uses: SparkUniverse/workflows/.github/workflows/argo-update.yaml@main | |
| secrets: | |
| ARGOCD_DEPLOY_KEY: ${{ secrets.ARGOCD_DEPLOY_KEY }} | |
| with: | |
| application-set: launcher-meta | |
| branch: main | |
| environment-name: production |