Merge branch 'development' into improve-predictions #79
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
| # This workflow will perform following actions when code is pushed to the development branch: | ||
| # - Run tests and linting checks (can be enabled via needs: test_and_lint) | ||
| # - Build and push nmrKit Docker image with layer caching for faster builds | ||
| # - Conditionally build nmr-cli image only if files in app/scripts/nmr-cli/ changed | ||
| # - Push images to Docker Hub under namespace nfdi4chem with dev-latest tag | ||
| # - Prevent redundant builds using concurrency control | ||
| # | ||
| # Maintainers: | ||
| # - name: Nisha Sharma | ||
| # - email: nisha.sharma@uni-jena.de | ||
| name : Prod Build and Publish to Dev | ||
| on: | ||
| push: | ||
| branches: [development] | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| env: | ||
| NMRKIT_REPOSITORY_NAME: nmrkit | ||
| NMR_CLI_REPOSITORY_NAME: nmr-cli | ||
| REPOSITORY_NAMESPACE: nfdi4chem | ||
| RELEASE_TAG: dev-latest | ||
| jobs: | ||
| # test_and_lint: | ||
| # uses: NFDI4Chem/nmrkit/.github/workflows/test.yml@main | ||
| build_and_push_to_registry: | ||
| name: Push Docker image to Docker Hub | ||
| runs-on: ubuntu-latest | ||
| needs: test_and_lint | ||
| steps: | ||
| # Clone repository code to runner | ||
| - name: Check out the repo | ||
| uses: actions/checkout@v4 | ||
| # Enable advanced Docker build features (required for caching) | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| # Authenticate with Docker Hub for image push access | ||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
| # Detect changes in nmr-cli folder to skip unnecessary builds | ||
| - name: Check for file changes | ||
| id: changes | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| filters: | | ||
| nmr-cli: | ||
| - 'app/scripts/nmr-cli/**' | ||
| # Build main nmrKit image with registry caching for faster builds | ||
| - name: Build and push nmrKit Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| build-args: RELEASE_VERSION=${{ env.RELEASE_TAG }} | ||
| tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} | ||
| cache-from: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:buildcache | ||
| cache-to: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:buildcache,mode=max | ||
| # Build nmr-cli image only if files in app/scripts/nmr-cli/ changed | ||
| - name: Build and push nmr-cli Docker image | ||
| if: steps.changes.outputs.nmr-cli == 'true' | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: ./app/scripts/nmr-cli/ | ||
| file: ./app/scripts/nmr-cli/Dockerfile | ||
| push: true | ||
| build-args: RELEASE_VERSION=${{ env.RELEASE_TAG }} | ||
| tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }} | ||
| cache-from: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:buildcache | ||
| cache-to: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:buildcache,mode=max | ||