Update README.md #68
This file contains 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 development images | |
on: | |
push: | |
branches: | |
- dev | |
env: | |
REGISTRY_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
REGISTRY_TOKEN: ${{ secrets.DOCKER_TOKEN }} | |
DOCKER_REGISTRY_LOGIN: "dockerhub.ebi.ac.uk" | |
SINGULARITY_REGISTRY_LOGIN: "oras://dockerhub.ebi.ac.uk" | |
DOCKER_REGISTRY: "dockerhub.ebi.ac.uk/gdp-public/pgscatalog_utils" | |
SINGULARITY_REGISTRY: "oras://dockerhub.ebi.ac.uk/gdp-public/pgscatalog_utils/singularity" | |
SINGULARITY_VERSION: "3.8.3" | |
jobs: | |
build_docker_dev: | |
name: build docker development image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out pipeline code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY_LOGIN }} | |
username: ${{ env.REGISTRY_USERNAME }} | |
password: ${{ env.REGISTRY_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
platforms: "linux/amd64,linux/arm64" | |
tags: ${{ env.DOCKER_REGISTRY }}/pgscatalog_utils:dev | |
build_singularity_dev: | |
needs: build_docker_dev | |
name: build singularity development image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out pipeline code | |
uses: actions/checkout@v3 | |
- name: Cache singularity setup | |
id: cache-singularity | |
uses: actions/cache@v3 | |
with: | |
path: /opt/hostedtoolcache/singularity/${{ env.SINGULARITY_VERSION }}/x64 | |
key: ${{ runner.os }}-singularity-${{ env.SINGULARITY_VERSION }} | |
- name: Set up Singularity | |
uses: eWaterCycle/setup-singularity@v7 | |
if: steps.cache-singularity.outputs.cache-hit != 'true' | |
with: | |
singularity-version: ${{ env.SINGULARITY_VERSION }} | |
- name: Add singularity to path | |
if: steps.cache-singularity.outputs.cache-hit == 'true' | |
run: | | |
echo "/opt/hostedtoolcache/singularity/${{ env.SINGULARITY_VERSION }}/x64/bin" >> $GITHUB_PATH | |
- name: Build singularity image | |
run: singularity build img.sif "docker://${DOCKER_REGISTRY}/pgscatalog_utils:dev" | |
- name: Push singularity image | |
run: | | |
echo "$REGISTRY_TOKEN" | singularity remote login -u "$REGISTRY_USERNAME" --password-stdin "$SINGULARITY_REGISTRY_LOGIN" | |
singularity push img.sif "${SINGULARITY_REGISTRY}/pgscatalog_utils:dev" |