Bump JamesIves/github-pages-deploy-action from 4.6.0 to 4.6.3 #57
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: | |
- main | |
tags: | |
- "v*" | |
paths: | |
- ".github/workflows/**" | |
- "src/**" | |
- "test/**" | |
- "test-postgres/**" | |
- "test-redis/**" | |
- "package.yaml" | |
- "stack*.yaml" | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
resolver: | |
- "stack-lts11" | |
- "stack-lts18" | |
postgres-flag: | |
- "" | |
- "--flag network-wait:postgres" | |
redis-flag: | |
- "" | |
- "--flag network-wait:redis" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell/actions/setup@v2 | |
id: install-haskell | |
with: | |
enable-stack: true | |
stack-version: "latest" | |
stack-no-global: true | |
- name: Write flags to file (for hashing) | |
run: | | |
echo ${{ matrix.postgres-flag }} > .cabal-flags | |
echo ${{ matrix.redis-flag }} >> .cabal-flags | |
cat .cabal-flags | |
- name: Cache .stack | |
id: cache-stack | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.install-haskell.outputs.stack-root }} | |
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(format('{0}.yaml', matrix.resolver)) }}-${{ hashFiles('*.cabal') }}-${{ hashFiles('.cabal-flags') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(format('{0}.yaml', matrix.resolver)) }}-${{ hashFiles('*.cabal') }}- | |
${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(format('{0}.yaml', matrix.resolver)) }}- | |
${{ runner.os }}-${{ matrix.resolver }}- | |
- name: Install dependencies | |
run: | | |
stack --system-ghc --stack-yaml=${{ matrix.resolver }}.yaml --no-terminal build \ | |
${{ matrix.postgres-flag }} \ | |
${{ matrix.redis-flag }} \ | |
--only-dependencies --test --haddock --fast | |
- name: Build | |
id: build | |
run: | | |
stack --system-ghc --stack-yaml=${{ matrix.resolver }}.yaml --no-terminal build \ | |
${{ matrix.postgres-flag }} \ | |
${{ matrix.redis-flag }} \ | |
--fast --test --haddock --no-run-tests | |
- name: Deploy documentation | |
# only deploy the documentation for a build on `main` with all flags enabled | |
if: | | |
github.ref == 'refs/heads/main' && | |
matrix.resolver == 'stack-lts18' && | |
contains(matrix.postgres-flag, 'network-wait:postgres') && | |
contains(matrix.redis-flag, 'network-wait:redis') | |
uses: JamesIves/github-pages-deploy-action@v4.6.3 | |
with: | |
branch: docs/${{ github.ref_name }} | |
folder: docs | |
- name: Start Docker containers (PostgreSQL) | |
if: ${{ contains(matrix.postgres-flag, 'network-wait:postgres') }} | |
run: | | |
docker-compose -p postgres -f docker-compose.postgresql.yaml up -d | |
- name: Start Docker containers (Redis) | |
if: ${{ contains(matrix.redis-flag, 'network-wait:redis') }} | |
run: | | |
docker-compose -p redis -f docker-compose.redis.yaml up -d | |
- name: Test | |
run: | | |
stack --system-ghc --stack-yaml=${{ matrix.resolver }}.yaml --no-terminal build \ | |
${{ matrix.postgres-flag }} \ | |
${{ matrix.redis-flag }} \ | |
--fast --test | |
- name: Stop Docker containers (PostgreSQL) | |
if: ${{ contains(matrix.postgres-flag, 'network-wait:postgres') }} | |
run: | | |
docker-compose -p postgres -f docker-compose.postgresql.yaml down | |
- name: Stop Docker containers (Redis) | |
if: ${{ contains(matrix.redis-flag, 'network-wait:redis') }} | |
run: | | |
docker-compose -p redis -f docker-compose.redis.yaml down |