Merge pull request #1404 from elgohr-update/master #184
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: "Docker" | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.dockerignore' | |
- '.github/workflows/docker.yml' | |
- 'Dockerfile' | |
- 'LICENSE' | |
- 'ghc-parser/**' | |
- 'html/**' | |
- 'ihaskell-display/**' | |
- 'ihaskell.cabal' | |
- 'ipython-kernel/**' | |
- 'jupyterlab-ihaskell/**' | |
- 'main/**' | |
- 'src/**' | |
- 'stack.yaml' | |
pull_request: | |
paths: | |
- '.dockerignore' | |
- '.github/workflows/docker.yml' | |
- 'Dockerfile' | |
- 'LICENSE' | |
- 'ghc-parser/**' | |
- 'html/**' | |
- 'ihaskell-display/**' | |
- 'ihaskell.cabal' | |
- 'ipython-kernel/**' | |
- 'jupyterlab-ihaskell/**' | |
- 'main/**' | |
- 'src/**' | |
- 'stack.yaml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Stack | |
run: | | |
export PATH=$HOME/.local/bin:$PATH | |
mkdir -p ~/.local/bin | |
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' | |
- name: Check Dockerfile GHC version matches | |
run: | | |
set -e | |
STACK_GHC_VERSION=$(stack exec -- ghc --version | awk '{ print $NF }') | |
DOCKER_GHC_VERSION=$(sed -n 's/ARG GHC_VERSION=\(.*\)/\1/p' Dockerfile) | |
if [[ ${STACK_GHC_VERSION} != ${DOCKER_GHC_VERSION} ]]; then | |
echo 'GHC_VERSION in Dockerfile does not match stack resolver' | |
echo "GHC_VERSION should be ${STACK_GHC_VERSION}" | |
exit 1 | |
fi | |
- uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: gibiansky/ihaskell | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
snapshot: true | |
no_push: ${{ github.event_name == 'pull_request' }} |