Maybe this work #1709
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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - 'release/*' | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+*' | |
| pull_request: | |
| types: [ opened, synchronize ] | |
| workflow_dispatch: | |
| env: | |
| PRIVATE_DOCKER_REGISTRY_URL: ${{ secrets.GITLAB_DOCKER_REGISTRY_URL }} | |
| PRIVATE_DOCKER_REGISTRY_USER: Deploy-Token | |
| PRIVATE_DOCKER_REGISTRY_PASS: ${{ secrets.GITLAB_PKG_REGISTRY_TOKEN }} | |
| DOCKER_PUSH: true | |
| REEVE_DB_MIGRATIONS_REPO: cardano-foundation/cf-reeve-db-migrations | |
| REEVE_DB_MIGRATIONS_REF: main | |
| REEVE_DB_MIGRATIONS_PATH: cf-application/src/main/resources/db/migration/postgresql/cf-reeve-db-migrations | |
| GITLAB_MAVEN_REGISTRY_URL: ${{ secrets.GITLAB_MAVEN_REGISTRY_URL }} | |
| jobs: | |
| publish: | |
| permissions: | |
| contents: write | |
| packages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Checkout cf-reeve-db-migrations | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ env.REEVE_DB_MIGRATIONS_REPO }} | |
| ref: ${{ env.REEVE_DB_MIGRATIONS_REF }} | |
| ssh-key: ${{ secrets.CF_REEVE_DB_MIGRATIONS_SSH_DEPLOY_KEY }} | |
| path: ${{ env.REEVE_DB_MIGRATIONS_PATH }} | |
| - name: ⛮ cf-gha-baseline | |
| uses: cardano-foundation/cf-gha-workflows/./actions/cf-gha-baseline@main | |
| id: cf-gha-baseline | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PRIVATE_DOCKER_REGISTRY_URL: ${{ env.PRIVATE_DOCKER_REGISTRY_URL }} | |
| PRIVATE_DOCKER_REGISTRY_USER: ${{ env.PRIVATE_DOCKER_REGISTRY_USER }} | |
| PRIVATE_DOCKER_REGISTRY_PASS: ${{ env.PRIVATE_DOCKER_REGISTRY_PASS }} | |
| HUB_DOCKER_COM_USER: ${{ secrets.HUB_DOCKER_COM_USER }} | |
| HUB_DOCKER_COM_PASS: ${{ secrets.HUB_DOCKER_COM_PASS }} | |
| DOCKER_REGISTRIES: "${{ secrets.DOCKER_REGISTRIES }}" | |
| - name: 🌍 earthly (docker build and push) | |
| run: | | |
| earthly +docker-publish \ | |
| --PUSH=${DOCKER_PUSH} \ | |
| --DOCKER_REGISTRIES="${{ env.DOCKER_REGISTRIES_FILTERED }}" \ | |
| --DOCKER_IMAGES_EXTRA_TAGS="${EARTHLY_DOCKER_IMAGES_EXTRA_TAGS}" \ | |
| --GITLAB_MAVEN_REGISTRY_URL="${GITLAB_MAVEN_REGISTRY_URL}" | |
| - name: Set event dispatch type | |
| id: set-event-dispatch-type | |
| if: steps.cf-gha-baseline.outputs.TRIGGERING_REF == 'tag' | |
| run: | | |
| if [[ ${{ steps.cf-gha-baseline.outputs.TAG_NAME }} =~ .*rc[0-9]+$ ]]; then | |
| echo "EVENT_TYPE=cf-lob-${{ github.event_name }}-${{ steps.cf-gha-baseline.outputs.TRIGGERING_REF }}-rc" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT | |
| elif [[ ${{ steps.cf-gha-baseline.outputs.TAG_NAME }} =~ .*rc[0-9]+-qa-signoff$ ]]; then | |
| echo "EVENT_TYPE=cf-lob-${{ github.event_name }}-${{ steps.cf-gha-baseline.outputs.TRIGGERING_REF }}-rc-qa-signoff" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT | |
| else | |
| echo "EVENT_TYPE=cf-lob-${{ github.event_name }}-${{ steps.cf-gha-baseline.outputs.TRIGGERING_REF }}" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT | |
| fi | |
| - name: Dispatch successful build event to private repo | |
| uses: cardano-foundation/cf-gha-workflows/./actions/cf-gha-dispatch-event@main | |
| if: steps.cf-gha-baseline.outputs.TRIGGERING_REF == 'tag' | |
| with: | |
| EVENT_TYPE: ${{ steps.set-event-dispatch-type.outputs.EVENT_TYPE }} | |
| GITHUB_TOKEN: ${{ secrets.PRIVATE_REPO_PAT }} | |
| GITHUB_REPO: ${{ secrets.PRIVATE_REPO }} | |
| TRIGGERING_EVENT: ${{ github.event_name }} | |
| TRIGGERING_REF: ${{ steps.cf-gha-baseline.outputs.TRIGGERING_REF }} | |
| TRIGGERING_BRANCH: ${{ steps.cf-gha-baseline.outputs.BRANCH_NAME }} | |
| TRIGGERING_TAG: ${{ steps.cf-gha-baseline.outputs.TAG_NAME }} | |
| TRIGGERING_GHRUNID: ${{ github.run_id }} | |
| GIT_SHORT_COMMIT: ${{ steps.cf-gha-baseline.outputs.GIT_SHORT_COMMIT }} |