image: 
    name: quay.io/singularity/singularity:v3.4.0
    entrypoint: [""]

stages:
  - build
  - deploy

# Build Singularity container
singularity-image:
  stage: build
  script: 
     - singularity build container.sif Singularity
  artifacts:
    paths:
     - container.sif

# Push the image on the registry
deploy:
  stage: deploy
  script:
          - singularity push --docker-username gitlab-ci-token --docker-password $CI_JOB_TOKEN container.sif oras://"$CI_REGISTRY_IMAGE"/"$CI_PROJECT_NAME":"$CI_COMMIT_TAG"
