Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Demo from AWS Lightsail to GitPages #2034

Merged
merged 14 commits into from
Aug 12, 2024
80 changes: 80 additions & 0 deletions .github/workflows/deploy-demo-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["demo-test"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jitu5 marked this conversation as resolved.
Show resolved Hide resolved

# 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

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
jitu5 marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python '3.9'
uses: actions/setup-python@v5
with:
python-version: '3.9'
jitu5 marked this conversation as resolved.
Show resolved Hide resolved

- name: Cache python packages for Linux
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ubuntu-latest-python-3.9

- name: Install Kedro and other Python Dependencies
uses: "./.github/actions/install_kedro_and_python_dependencies"

- name: Setup Node.js and Install Dependencies
uses: "./.github/actions/install_node_dependencies"

- name: Build React application
run: |-
node -v
make build

- name: Install Kedro-Viz development package
run: |
pip install -e package
shell: bash

- name: Update demo-project build directory wit the latest changes
run: |
cd demo-project
if ! (kedro viz build |& tee /dev/stderr | grep -i -q "Success!"); then
exit 1
fi
shell: bash


- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'demo-project/build'
- name: Deploy to GitHub Pages
id: deployment
jitu5 marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cypress/screenshots
cypress/downloads/

# production
build/
/build/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build seems to be in the root similar to lib. Why is this needed ?

Copy link
Contributor Author

@rashidakanchwala rashidakanchwala Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to ignore the root build but keep the demo/build. build folder is created when you do npm run build and we don't want to accidentally push that to github.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I understand that. Before this change we were doing the same right. The forward slash might not be needed I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i remove the forward slash, it also ignores the demo/build which we don't want to ignore anymore as it has static graphql files

lib/

# misc
Expand Down
2 changes: 1 addition & 1 deletion demo-project/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ __pycache__/

# Distribution / packaging
.Python
build/

develop-eggs/
dist/
downloads/
Expand Down
12 changes: 12 additions & 0 deletions demo-project/build/api/package-compatibilities
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"package_name": "fsspec",
"package_version": "2024.6.1",
"is_compatible": true
},
{
"package_name": "kedro-datasets",
"package_version": "4.0.0",
"is_compatible": true
}
]
Loading
Loading