Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire authored Dec 30, 2023
1 parent 9c080c8 commit 7fbad6c
Show file tree
Hide file tree
Showing 6 changed files with 538 additions and 462 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
"features": {
"ghcr.io/devcontainers-contrib/features/pipenv:2": {}
},
"postCreateCommand": "pipenv sync --dev"
}
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

66 changes: 38 additions & 28 deletions .github/workflows/continuous-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ jobs:
name: "Lint Python"
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pipenv'

- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: pipenv-install
name: Install Python dependencies
run: pip install flake8
run: pipenv sync --dev

- name: Lint
run: flake8 postgres_copy
Expand All @@ -39,28 +45,31 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
django: ["3.2", "4.1", "4.2"]
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
django: ['3.2', '4.2', '5.0']
exclude:
- python: "3.8"
django: "4.2"
- python: "3.9"
django: "4.2"
- python: '3.7'
django: '4.2'
- python: '3.7'
django: '5.0'
- python: '3.8'
django: '5.0'
- python: '3.9'
django: '5.0'
steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev postgresql-client

- name: Install pipenv
run: pipx install pipenv
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pipenv'

- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: pipenv-install
name: Install Python dependencies
run: pipenv install flake8 psycopg2 django==${{ matrix.django }} mock --python=${{ matrix.python }} --skip-lock
Expand All @@ -76,19 +85,21 @@ jobs:
needs: [test-python,lint-python]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pipenv
run: pipx install pipenv

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pipenv'

- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: pipenv-install
name: Install Python dependencies
run: pipenv install --dev
run: pipenv sync --dev

- id: build
name: Build release
Expand Down Expand Up @@ -129,4 +140,3 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
verify_metadata: false
89 changes: 67 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,75 @@
name: "Build documentation"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
docs:
name: "Build and deploy"
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"

- uses: actions/upload-artifact@v3
with:
name: documentation-html
path: docs/_build/html/

- uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }}
source_dir: docs/_build/html/
destination_dir: django-postgres-copy
- id: checkout
name: Checkout
uses: actions/checkout@v4

- id: setup-python
name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pipenv'

- id: install-pipenv
name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
shell: bash

- id: install-python-dependencies
name: Install Python dependencies
run: pipenv sync --dev
shell: bash

- id: build-sphinx-documentation
name: Build Sphinx documentation
run: pipenv run make html
shell: bash
working-directory: docs

- id: upload-release-candidate
name: Upload release candidate
uses: actions/upload-artifact@v3
with:
name: release-candidate
path: ./docs/_build/html/

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_name == 'main' }}
steps:
- name: Download release candidate
uses: actions/download-artifact@v3
with:
name: release-candidate
path: ./docs/

- id: configure-aws
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- id: upload-to-s3
name: Upload documentation to Amazon S3
uses: datadesk/delivery-deploy-action@v1
with:
bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }}
base-path: django-postgres-copy/
dir: ./docs/
should-cache: false
use-accelerate-endpoint: false
public: true
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ wheel = "*"
pre-commit = "*"

[requires]
python_version = "3.10"
python_version = "3.11"
Loading

0 comments on commit 7fbad6c

Please sign in to comment.