Skip to content

Commit

Permalink
Distinct workflows for build and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Swordlash committed Jan 19, 2025
1 parent dbb160d commit d289807
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 34 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build & deploy

on:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

name: CI Build

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
EM_VERSION: 3.1.74
EM_CACHE_FOLDER: 'emsdk-cache'

jobs:
build-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Setup cache
id: cache-system-libraries
uses: actions/cache@v2
with:
path: ${{env.EM_CACHE_FOLDER}}
key: emsdk-${{env.EM_VERSION}}-${{ runner.os }}

- name: Setup EMSDK
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

- name: Install dependencies
run: |
npm install
npx ghc-installer install cabal 3.14.1.1
npx ghc-installer install ghc 9.12.1
mkdir -p /home/runner/.cabal/store
- name: Builtin cabal update & freeze
run: |
npx ghc-installer run cabal update
npx ghc-installer run cabal freeze
- name: Cache cabal dependencies
uses: actions/cache@v3
with:
path: /home/runner/.cabal/store
key: ${{ runner.os }}-cabal-store
restore-keys: |
${{ runner.os }}-cabal-store
- name: Build
run: npm run build-ci

- name: Upload dist to GH Pages artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,4 @@ jobs:
${{ runner.os }}-cabal-store
- name: Build
run: npm run build-ci

- name: Upload dist to GH Pages artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
run: npm run build-ci
27 changes: 0 additions & 27 deletions .github/workflows/deploy.yml

This file was deleted.

0 comments on commit d289807

Please sign in to comment.