Skip to content

Commit

Permalink
Merge pull request #54 from eyra/embedded-mode
Browse files Browse the repository at this point in the history
Added embedded mode (iframe)
  • Loading branch information
mellelieuwes authored Oct 3, 2023
2 parents eff2988 + be16f3b commit fb8d309
Show file tree
Hide file tree
Showing 113 changed files with 584 additions and 3,095 deletions.
4 changes: 4 additions & 0 deletions .earthlyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
build
.git
release.zip
28 changes: 28 additions & 0 deletions .github/workflows/_build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
workflow_call:
outputs:
archive:
description: "The name of the archive (ZIP)"
value: ${{jobs.release.outputs.archive}}

jobs:
release:
runs-on: ubuntu-latest
env:
MIX_ENV: prod
outputs:
archive: ${{ steps.tag.outputs.tag }}.zip
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Tag name
id: tag
run: echo "name=tag::v$(date +%F)_${{github.run_number}}" >> $GITHUB_OUTPUT

- uses: earthly/actions-setup@v1
with:
version: v0.7.8

- name: Build release
run: earthly +release --release_tag=${{steps.tag.outputs.tag}}
26 changes: 7 additions & 19 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set PUBLIC_URL in .env
run: |
REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)
echo "PUBLIC_URL=https://$(echo $GITHUB_REPOSITORY | cut -d'/' -f1).github.io/$REPO_NAME/" >> .env
- name: Setup Node.js
uses: actions/setup-node@v3
- uses: earthly/actions-setup@v1
with:
node-version-file: ".tool-versions"
version: v0.7.8

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies and build
run: |
npm install
python -m pip install --upgrade pip
python -m pip install poetry
npm run dev:build
- name: Build release
run: earthly +release

- name: Unpack release
run: unzip release.zip -d build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release

on: workflow_dispatch

jobs:
build_release:
uses: ./.github/workflows/_build_release.yml

tagged_release:
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v1
with:
tag_name: "${{ needs.build_release.outputs.archive }}"
prerelease: false
fail_on_unmatched_files: true
files: |
${{ needs.release.outputs.archive }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

release.zip

# dependencies
/node_modules
/.pnp
Expand Down
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run prod:clean
npm run prod
npm run ci:test
earthly +commit-hook

diff=$(git diff --name-only)

Expand Down
42 changes: 42 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
VERSION 0.7
FROM node:18-bookworm
WORKDIR /code/
ENV CI=true

commit-hook:
BUILD +test
BUILD +lint

setup-base:
COPY package.json package-lock.json ./
RUN npm ci
COPY --dir . ./

test:
FROM +setup-base
RUN npm run test

lint:
FROM +setup-base
RUN npm run lint

build-py:
FROM python:3.11
WORKDIR /py
RUN python -m pip install poetry
COPY --dir src/framework/processing/py /
RUN poetry install
RUN poetry build --format wheel
SAVE ARTIFACT dist/

release:
BUILD +build-py
ARG release_tag=release
FROM +setup-base
RUN apt-get update && apt install -y zip
COPY +build-py/dist/* public/
RUN npm run build:css
RUN --no-cache npx update-browserslist-db@latest
RUN npm run build:app
RUN npm run archive
SAVE ARTIFACT release.zip AS LOCAL $release_tag.zip
Loading

0 comments on commit fb8d309

Please sign in to comment.