docker: add README.md #1
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: [pull_request, push, merge_group] | |
| name: ci | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| generate-matrix: | |
| # https://stackoverflow.com/questions/59977364 | |
| name: Generate build matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - id: set-matrix | |
| run: echo "matrix=$(src/test/generate_matrix.py)" >> $GITHUB_OUTPUT | |
| - run: src/test/generate_matrix.py | jq -S . | |
| - run: echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads}" >> $GITHUB_OUTPUT | |
| - run: echo "GITHUB_TAG=${GITHUB_REF#refs/tags}" >> $GITHUB_OUTPUT | |
| - run: echo "EVENT_NAME=${{ github.event_name }}" >> $GITHUB_OUTPUT | |
| ci-checks: | |
| needs: [generate-matrix] | |
| runs-on: ${{matrix.runner}} | |
| env: | |
| TAP_DRIVER_QUIET: 1 | |
| FLUX_TEST_TIMEOUT: 300 | |
| DOCKER_REPO: libscr/scr | |
| DOCKER_USERNAME: libscr | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| strategy: | |
| matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} | |
| fail-fast: false | |
| name: ${{matrix.name}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: fetch annotated tag | |
| if: > | |
| (matrix.create_release || matrix.docker_tag) && | |
| github.ref != 'refs/heads/master' | |
| run: | | |
| # Ensure git-describe works on a tag. | |
| # (checkout@v4 action may have left current tag as | |
| # lightweight instead of annotated. See | |
| # https://github.com/actions/checkout/issues/290) | |
| # | |
| echo github.ref == ${{ github.ref }} ; | |
| git fetch -f origin ${{ github.ref }}:${{ github.ref }} ; | |
| echo git describe now reports $(git describe --always) | |
| - name: docker buildx | |
| uses: docker/setup-buildx-action@v3 | |
| if: matrix.needs_buildx | |
| - name: docker-run-checks | |
| timeout-minutes: ${{matrix.timeout_minutes}} | |
| env: ${{matrix.env}} | |
| run: ${{matrix.command}} | |
| - name: docker deploy | |
| if: success() && matrix.docker_tag | |
| env: ${{matrix.env}} | |
| run: src/test/docker-deploy.sh | |
| - name: create release | |
| id: create_release | |
| if: | | |
| success() | |
| && matrix.create_release | |
| && github.repository == 'LLNL/scr' | |
| env: ${{matrix.env}} | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ matrix.tag }} | |
| name: scr ${{ matrix.tag }} | |
| prerelease: true | |
| files: scr*.tar.gz | |
| body: | | |
| View [Release Notes](https://github.com/${{ github.repository }}/blob/${{ matrix.tag }}/NEWS.md) for scr ${{ matrix.tag }} | |
| generate-manifest: | |
| name: Generate docker manifest | |
| runs-on: ubuntu-latest | |
| needs: [ci-checks] | |
| env: | |
| DOCKER_REPO: libscr/scr | |
| DOCKER_USERNAME: libscr | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: make and push manifest as libscr/scr | |
| if: > | |
| (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') | |
| run: | | |
| echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | |
| docker manifest push libscr/scr:bookworm | |
| for d in el9 alpine fedora40 bookworm ; do | |
| docker manifest create libscr/scr:$d libscr/scr:$d-amd64 libscr/scr:$d-arm64 | |
| docker manifest push libscr/scr:$d | |
| done | |