Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/jitu5/kedro-viz
Browse files Browse the repository at this point in the history
  • Loading branch information
jitu5 committed Apr 23, 2024
2 parents ecacbf0 + a12def4 commit 5ebc800
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -36,9 +36,17 @@ jobs:
package_name: ${{ steps.version_check.outputs.package_name }}
package_version: ${{ steps.version_check.outputs.package_version }}

prepare-release:
needs: [check-version]
test-kedro-viz:
needs: check-version
if: ${{ needs.check-version.outputs.new_release == 'true' }}
uses: ./.github/workflows/all-checks.yml

prepare-release:
needs: [check-version, test-kedro-viz]
if: |
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
needs.check-version.outputs.new_release == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -63,4 +71,4 @@ jobs:
body_path: release_body.txt
draft: false
prerelease: false
token: ${{ secrets.GH_TAGGING_TOKEN }}
token: ${{ secrets.GH_TAGGING_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy demo
# Builds a Docker image of the demo project, pushes it to
# AWS ECR, and deploys it to AWS Lightsail.

on:
workflow_dispatch:
push:
branches:
- demo
jobs:
deploy_demo:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup environment
run: |-
cd demo-project
echo "AWS_ECR_URL=public.ecr.aws/h1b3x4b6/jitu5-kedro-viz" >> $GITHUB_ENV
echo "KEDRO_VIZ_VERSION=$(cat .version)" >> $GITHUB_ENV
- name: Install AWS CLI
run: pip3 install awscli

- name: Build demo container image
run: |-
cd demo-project
echo "kedro_viz==$KEDRO_VIZ_VERSION" >> src/docker_requirements.txt
docker build -t $AWS_ECR_URL:$KEDRO_VIZ_VERSION .
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
docker push $AWS_ECR_URL:$KEDRO_VIZ_VERSION
- name: Create a new lightsail deployment
run: |-
cd demo-project
# run https://docs.aws.amazon.com/cli/latest/reference/lightsail/create-container-service-deployment.html#create-container-service-deployment
aws lightsail create-container-service-deployment --region eu-west-2 --cli-input-json file://./lightsail.json
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release to NPM and PyPI
# Builds and releases the application to NPM and PyPI
# when a new release is published or the workflow is manually triggered.

on:
release:
types: [published]
workflow_dispatch:
env:
# AWS_REGION: xxxxst-2
# CACHE_VERSION: xxxx
# SNYK_TOKEN: xxxxa727
TWINE_NON_INTERACTIVE: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_REPOSITORY_URL: ${{ secrets.TWINE_REPOSITORY_URL }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
jobs:
release_to_npm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18.20.0
registry-url: 'https://registry.npmjs.org'

- name: Install Node dependencies
run: npm install

- name: Build React application
run: |-
node -v
make build
- name: Publish to npm
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release_to_pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Tests
uses: "./.github/actions/setup_tests"

- name: Make Python package
run: make package

- name: Install twine
run: python -m pip install -U twine

- name: Publish to PyPI
run: python -m twine upload package/dist/*

0 comments on commit 5ebc800

Please sign in to comment.