Skip to content

Commit

Permalink
BETA: add experimental actions for building/deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
linusha committed Aug 2, 2023
1 parent 3c0ddc7 commit 2346f11
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-upload-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Project

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout lively.next
uses: actions/checkout@v3
with:
repository: LivelyKernel/lively.next
ref: 3596b124e6edc271afc4baf4666b759442e25016
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '18.12.1'
- name: Install lively.next
run: |
chmod a+x ./install.sh
./install.sh
- name: Checkout Project Repository
uses: actions/checkout@v3
with:
path: local_projects/LivelyKernel--froscon-2023
- name: Build Project
run: npm run build --prefix local_projects/LivelyKernel--froscon-2023
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: local_projects/LivelyKernel--froscon-2023/build
80 changes: 80 additions & 0 deletions .github/workflows/deploy-pages-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Deploy static content to Pages

on:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
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: "build-and-deploy"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '18.12.1'
- name: Checkout lively.next
uses: actions/checkout@v3
with:
repository: LivelyKernel/lively.next
fetch-depth: ''
ref: 8d5b8f976add0ee383dbcb54eaf65bebeaab1a08
- name: Restore lively.next installation
id: cache-lively-installation
uses: actions/cache/restore@v3
env:
cache-name: cache-lively-installation
ref: 8d5b8f976add0ee383dbcb54eaf65bebeaab1a08
with:
path: .
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.ref }}
- if: ${{ steps.cache-lively-installation.cache-hit != 'true' }}
name: Install lively.next
run: |
chmod a+x ./install.sh
./install.sh
- if: ${{ steps.cache-lively-installation.cache-hit != 'true' }}
name: Save lively installation in cache
uses: actions/cache/save@v3
env:
cache-name: cache-lively-installation
ref: 8d5b8f976add0ee383dbcb54eaf65bebeaab1a08
with:
path: .
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.ref }}
- name: Checkout Project Repository
uses: actions/checkout@v3
with:
path: local_projects/LivelyKernel--froscon-2023
- name: Build Project
run: npm run build-minified --prefix local_projects/LivelyKernel--froscon-2023
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: local_projects/LivelyKernel--froscon-2023/build
deploy:
needs: [build]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
- name: Delete uploaded Artifact
uses: geekyeggo/delete-artifact@v2
with:
name: github-pages

0 comments on commit 2346f11

Please sign in to comment.