-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e08252f
Showing
79 changed files
with
20,264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Release & publish | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish_pip: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'npm' | ||
cache-dependency-path: webapp/package-lock.json | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
api/setup.py | ||
cli/setup.py | ||
- name: Install dependencies | ||
run: pip install wheel twine | ||
- name: CLI build | ||
run: cd cli && python ./setup.py bdist_wheel sdist | ||
- name: API build | ||
run: cd api && python ./setup.py bdist_wheel sdist | ||
- name: Webapp wheel build | ||
run: | | ||
cd webapp && npm i | ||
npm run build | ||
python ./setup.py bdist_wheel | ||
- name: Publish to Pypi | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
echo cli/dist/* api/dist/* webapp/dist/* | ||
twine upload cli/dist/* api/dist/* webapp/dist/* | ||
publish_docker: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: aguinet/secsend:${{ github.event.release.tag_name }} | ||
file: Dockerfile.prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'npm' | ||
cache-dependency-path: webapp/package-lock.json | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
api/setup.py | ||
cli/setup.py | ||
- name: CLI tests | ||
run: cd cli && pip install -e .[dev] && cd tests && python -m unittest | ||
- name: API tests | ||
run: cd api && pip install -e .[dev] && cd tests && python -m unittest | ||
- name: Webapp tests | ||
run: cd webapp && npm i && npm run eslint && npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:18-bullseye-slim as builder | ||
RUN apt-get update && DEBIAN_FRONTEND=non-interactive apt-get install -yqq \ | ||
python3 python3-pip && \ | ||
mkdir /tmp/secsend | ||
COPY ./api /tmp/secsend/api | ||
COPY ./webapp /tmp/secsend/webapp | ||
COPY ./__version__.py /tmp/secsend | ||
|
||
RUN cd /tmp/secsend/api && python3 ./setup.py bdist_wheel | ||
RUN cd /tmp/secsend/webapp && npm install && npm run build && python3 ./setup.py bdist_wheel | ||
|
||
FROM python:3.10-slim-bullseye | ||
|
||
COPY --from=builder /tmp/secsend/api/dist/*.whl /tmp | ||
COPY --from=builder /tmp/secsend/webapp/dist/*.whl /tmp | ||
RUN pip install /tmp/*.whl && rm /tmp/*.whl | ||
|
||
ENV SECSEND_BACKEND_FILES_ROOT=/data | ||
ENTRYPOINT /usr/local/bin/sanic secsend_api.prod.app -p ${SECSEND_LISTEN_PORT:-8000} -H 0.0.0.0 |
Oops, something went wrong.