Skip to content

Deploying to pages

Deploying to pages #7

Workflow file for this run

name: Haskell CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- name: Copy repo into actions
uses: actions/checkout@v3
- name: install dependancies, build and test stack project.
uses: freckle/stack-action@v5
with:
stack-build-arguments: --ghc-options="-fno-warn-unused-imports -fno-warn-unused-matches -fno-warn-type-defaults -fno-warn-missing-export-lists"
stack-build-arguments-test: --ghc-options="-fno-warn-unused-imports -fno-warn-unused-matches -fno-warn-type-defaults -fno-warn-missing-export-lists"
- name: Set up environment variable
run: echo "FLAVOUR=9.8" >> $GITHUB_ENV
- name: Download wasm32-wasi-cabal
run: |
curl https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/raw/master/bootstrap.sh | sh
source ~/.ghc-wasm/add_to_github_path.sh
- name: Building wasm
run: |
wasm32-wasi-cabal build sql2er-wasm -f build-sql2er-wasm
deploy:
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-22.04
needs: build
steps:
- name: Copy binary and index.html
- run: |
mkdir -p artifact_dir
cp $(cabal list-bin sql2er-wasm -f build-sql2er-wasm) artifact_dir/
cp index.html artifact_dir/
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: artifact_dir/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4