Docker: Use base image with correct GHC version #111
Workflow file for this run
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: Haskell Stack CI | |
on: [push] | |
jobs: | |
linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache .stack-work | |
uses: actions/cache@v4 | |
with: | |
path: .stack-work | |
key: tasklite_stack-work_ubuntu | |
restore-keys: tasklite_stack-work_ubuntu | |
- name: Setup Stack | |
uses: haskell-actions/setup@v2 | |
with: | |
enable-stack: true | |
stack-no-global: true | |
- name: Cache Stack build files | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.stack | |
airsequel-cli/.stack-work | |
key: >- | |
${{ runner.os }}-stack-${{ | |
hashFiles('stack.yaml.lock', 'airsequel-cli/package.yaml') }} | |
restore-keys: | | |
${{runner.os}}-stack | |
- name: Install TaskLite CLI tool | |
run: stack install tasklite-core | |
- name: Run test suite | |
run: stack test | |
- name: Test adding of tasks | |
run: /home/runner/.local/bin/tasklite add Buy milk | |
- name: Test listing of tasks | |
run: /home/runner/.local/bin/tasklite | |
- name: Upload Linux Release | |
uses: actions/upload-artifact@v4 | |
with: | |
path: /home/runner/.local/bin/tasklite | |
name: tasklite_linux_x86_64.zip | |
macos: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache .stack-work | |
uses: actions/cache@v4 | |
with: | |
path: .stack-work | |
key: tasklite_stack-work_macos | |
restore-keys: tasklite_stack-work_macos | |
- name: Setup Stack | |
uses: haskell-actions/setup@v2 | |
with: | |
enable-stack: true | |
stack-no-global: true | |
- name: Install TaskLite CLI tool | |
run: stack install tasklite-core | |
- name: Run test suite | |
run: stack test | |
- name: Test adding of tasks | |
run: /Users/runner/.local/bin/tasklite add Buy milk | |
- name: Test listing of tasks | |
run: /Users/runner/.local/bin/tasklite | |
- name: Upload MacOS Release | |
uses: actions/upload-artifact@v4 | |
with: | |
path: /Users/runner/.local/bin/tasklite | |
name: tasklite_macos_x86_64.zip | |
docker: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Git Repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: adius/tasklite:latest | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
# windows: | |
# runs-on: windows-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Install stack | |
# shell: cmd | |
# run: choco install haskell-stack | |
# - name: Install dependencies | |
# run: stack install tasklite-core | |
# - name: Upload Windows Release | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# path: '%APPDATA%\local\bin\tasklite.exe' | |
# name: tasklite_windows_x86_64.exe | |
# publish: | |
# needs: build | |
# runs-on: ubuntu-18.04 | |
# steps: | |
# - name: Set env with output of `git describe` | |
# run: echo ::set-env name=GIT_DESCRIBE::$(git describe) | |
# | |
# - name: Create Release | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ env.GIT_DESCRIBE }} | |
# release_name: Release ${{ env.GIT_DESCRIBE }} | |
# body: ${{ github.event.commits[0].message }} | |
# draft: false | |
# prerelease: false |