Skip to content

shell one-line installer supports sh #69

shell one-line installer supports sh

shell one-line installer supports sh #69

name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
IMAGE_NAME: bigdatainbiomedicine/needl
TEST_TAG: test
LATEST_TAG: latest
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
- name: Build test image
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: .
file: docker/NeEDL/Dockerfile
tags: ${{ env.IMAGE_NAME }}:${{ env.TEST_TAG }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test
run: ./test/e2e/test_container.sh ${{ env.IMAGE_NAME }}:${{ env.TEST_TAG }}
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push final image
id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: .
file: docker/NeEDL/Dockerfile
target: release
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max