more lint #125
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
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
build-and-test: | |
name: Deploy site on ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [haskellorg, githubpages] | |
ghc: ["9.2.5"] | |
cabal: ["3.10.1"] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Install Haskell Toolchain | |
uses: haskell/actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- name: Configure the build plan | |
working-directory: message-index | |
run: | | |
cabal update | |
cabal build --dry-run | |
# cabal build --dry-run creates dist-newstyle/cache/plan.json | |
# Keep a watch on this `cabal-3.9 build --dry-run` bug: | |
# https://github.com/haskell/cabal/issues/8706 | |
- name: Read the Cabal cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cabal/store | |
message-index/dist-newstyle | |
key: | | |
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-${{ hashFiles('**/plan.json') }} | |
restore-keys: | | |
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}- | |
- name: Build with Hakyll | |
working-directory: message-index | |
run: cabal run site build | |
- name: Deploy on Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ (matrix.target == 'githubpages') && (github.ref == 'refs/heads/main') }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./message-index/_site | |
- name: Deploy on Haskell.org | |
if: ${{ matrix.target == 'haskellorg' }} | |
shell: bash | |
env: | |
# Create the secret with: | |
# | |
# Settings -> Secrets -> New Repository Secret -> | |
# | |
# Name: ERRORS_HASKELL_ORG_SSH_KEY | |
# Value: The text of the ssh private key | |
ERRORS_HASKELL_ORG_SSH_KEY: ${{ secrets.ERRORS_HASKELL_ORG_SSH_KEY }} | |
run: | | |
sudo apt-get install -y lftp | |
./deploy.sh --DEPLOY-IT-LIVE | |