Skip to content

Commit

Permalink
ci: implement (manual) deployment using GitHub actions (kantord#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
kantord authored Feb 26, 2023
1 parent 61f788f commit 32f18ea
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 65 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deployment to production
on: []

jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
node-version: ["14"]
os: [ubuntu-20.04]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: snok/install-poetry@v1
- name: Install Python Dependencies
shell: bash
run: poetry install
- name: validate that Test Course Json files are up to date
run: |
poetry install --no-interaction
cd apps/librelingo_yaml_loader
poetry install --no-interaction
cd ../librelingo_json_export
poetry install --no-interaction
cd ../..
./scripts/verifyTestCourseJsonFiles.sh
- name: install node dependencies
run: yarn install
- name: statically build entire website
run: NODE_ENV=production yarn export:production
- name: deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: __sapper__/export
cname: librelingo.app
3 changes: 2 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9"]
node-version: ["14"]
os: [ubuntu-20.04, windows-latest, macos-11]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -43,4 +45,3 @@ jobs:
poetry install --no-interaction
cd ../..
./scripts/verifyTestCourseJsonFiles.sh
39 changes: 0 additions & 39 deletions .semaphore/pipeline_2.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .semaphore/pipeline_3.yml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"cypress": "yarn web cypress",
"export:production": "yarn web installAllExternalCourses && yarn exportAllCourses && yarn web export && yarn docs:build && mv ./apps/web/__sapper__/ . && poetry run python apps/tools/librelingo_tools/generate.py --courses ./config/courses.json --outdir ./__sapper__/export/course-tools-legacy",
"export": "yarn web export && mv ./apps/web/__sapper__/ .",
"deploy": "echo 'librelingo.app' > __sapper__/export/CNAME && gh-pages -d __sapper__/export",
"commit": "git-cz",
"test": "jest",
"test:ci": "yarn web test:ci",
Expand Down Expand Up @@ -92,4 +91,4 @@
"msw": {
"workerDirectory": "apps/web/static"
}
}
}

0 comments on commit 32f18ea

Please sign in to comment.