Merge pull request #949 from PintoGideon/Pacs-Preview-Fix #205
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 | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
if: github.repository_owner == 'FNNDSC' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" # necessary for `npm run print-version` | |
- name: Get info | |
id: info | |
run: | | |
version="$(npm run -s print-version | tr '+' '-')" | |
echo "Version: $version" | |
echo "::set-output name=version_string::$version" | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: network=host | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to DockerHub | |
id: dockerhub_login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
tags: | | |
docker.io/fnndsc/chris_ui:latest | |
docker.io/fnndsc/chris_ui:${{ steps.info.outputs.version_string }} | |
ghcr.io/fnndsc/chris_ui:latest | |
ghcr.io/fnndsc/chris_ui:${{ steps.info.outputs.version_string }} | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: true | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Update DockerHub description | |
uses: peter-evans/dockerhub-description@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
short-description: ChRIS user interface | |
readme-filepath: ./README.md | |
repository: fnndsc/chris_ui |