|
1 | 1 | name: Build & publish containers |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
| 5 | + branches: [master] |
4 | 6 | push: |
5 | 7 | tags: |
6 | 8 | - 'v[0-9]+.[0-9]+.[0-9]+' |
|
9 | 11 | push_docker_to_registry: |
10 | 12 | name: Push Docker image to Docker Hub |
11 | 13 | runs-on: ubuntu-latest |
| 14 | + working-directory: bids-validator |
12 | 15 | steps: |
13 | 16 | - name: Check out the repo |
14 | 17 | uses: actions/checkout@v4 |
|
29 | 32 | uses: docker/build-push-action@v6 |
30 | 33 | with: |
31 | 34 | context: . |
32 | | - push: true |
| 35 | + push: false |
| 36 | + target: base |
33 | 37 | tags: ${{ steps.meta.outputs.tags }} |
34 | 38 | labels: ${{ steps.meta.outputs.labels }} |
35 | | - |
36 | | - push_singularity_to_registry: |
37 | | - runs-on: ubuntu-latest |
38 | | - needs: |
39 | | - - push_docker_to_registry |
40 | | - steps: |
41 | | - - name: Set up Go 1.13 |
42 | | - uses: actions/setup-go@v5 |
43 | | - with: |
44 | | - go-version: 1.13 |
45 | | - id: go |
46 | | - - name: Install Dependencies |
47 | | - run: | |
48 | | - sudo apt-get update && sudo apt-get install -y \ |
49 | | - build-essential \ |
50 | | - libssl-dev \ |
51 | | - uuid-dev \ |
52 | | - libgpgme11-dev \ |
53 | | - squashfs-tools \ |
54 | | - libseccomp-dev \ |
55 | | - pkg-config |
56 | | - - name: Install Singularity |
57 | | - env: |
58 | | - SINGULARITY_VERSION: 3.8.0 |
59 | | - GOPATH: /tmp/go |
60 | | - run: | |
61 | | - mkdir -p $GOPATH |
62 | | - sudo mkdir -p /usr/local/var/singularity/mnt && \ |
63 | | - mkdir -p $GOPATH/src/github.com/sylabs && \ |
64 | | - cd $GOPATH/src/github.com/sylabs && \ |
65 | | - wget -qO- https://github.com/sylabs/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-ce-${SINGULARITY_VERSION}.tar.gz | \ |
66 | | - tar xzv && \ |
67 | | - cd singularity-ce-${SINGULARITY_VERSION} && \ |
68 | | - ./mconfig -p /usr/local && \ |
69 | | - make -C builddir && \ |
70 | | - sudo make -C builddir install |
71 | | - - name: Check out code for the container build |
72 | | - uses: actions/checkout@v4 |
73 | | - - name: Extract metadata (tags, labels) for Docker |
74 | | - id: meta |
75 | | - uses: docker/metadata-action@v5 |
76 | | - with: |
77 | | - images: bids/validator |
78 | | - - name: Build Container |
79 | | - run: | |
80 | | - tags=${{ steps.meta.outputs.tags }} |
81 | | - echo $tags |
82 | | - singularity pull container.sif docker://${tags%,*} |
83 | | - - name: Login and Deploy Container |
84 | | - if: (github.event_name != 'pull_request') |
85 | | - run: | |
86 | | - tags=${{ steps.meta.outputs.tags }} |
87 | | - echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io |
88 | | - for tag in $(echo $tags | sed "s/,/ /g" | sed "s/bids\/validator/bids-standard\/bids-validator/g"); |
89 | | - do echo $tag; singularity push container.sif oras://ghcr.io/$tag; done |
| 39 | + outputs: type=cacheonly |
0 commit comments