Skip to content

Commit

Permalink
Update it all
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Jan 7, 2024
1 parent e2085f6 commit 824a575
Show file tree
Hide file tree
Showing 14 changed files with 696 additions and 869 deletions.
56 changes: 26 additions & 30 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Testing and deployment
name: Continuous Deployment

on:
push:
pull_request:
workflow_dispatch:

jobs:
Expand All @@ -9,19 +11,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pipenv'

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

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

- id: run
name: Run
Expand All @@ -30,21 +32,21 @@ jobs:
test-python:
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.9', '3.10', '3.11']
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

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

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

- id: pipenv-install
name: Install Python dependencies
run: pipenv install --skip-lock --python `which python`
Expand All @@ -61,19 +63,19 @@ jobs:
needs: [test-python]
steps:
- name: Checkout
uses: actions/checkout@v3

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

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pipenv'

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

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

- id: build
name: Build release
Expand All @@ -84,12 +86,11 @@ jobs:
- id: check
name: Check release
run: |
pipenv run twine check dist/*
run: pipenv run twine check dist/*

- id: save
name: Save artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: test-release-${{ github.run_number }}
path: ./dist
Expand All @@ -101,13 +102,9 @@ jobs:
needs: [test-build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/setup-python@v3
with:
python-version: '3.9'

- id: fetch
name: Fetch artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: test-release-${{ github.run_number }}
path: ./dist
Expand All @@ -119,4 +116,3 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
verify_metadata: false
94 changes: 72 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,79 @@
name: "Build documentation"
name: Documentation

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docs:
name: "Build and deploy"
build:
name: Build
runs-on: ubuntu-latest
steps:
- 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@v4
with:
name: release-candidate
path: ./docs/_build/html/

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_name == 'main' }}
steps:
- uses: actions/checkout@v2

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

- uses: actions/upload-artifact@v1
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: noaa-wildfires
- name: Download release candidate
uses: actions/download-artifact@v4
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: noaa-wildfires/
dir: ./docs/
should-cache: false
use-accelerate-endpoint: false
public: true
22 changes: 16 additions & 6 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ jobs:
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- id: install
name: Install Python, pipenv and Pipfile packages
uses: palewire/install-python-pipenv-pipfile@v2
- uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.11'
cache: 'pipenv'

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

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

- id: make
name: Run make command
Expand All @@ -27,6 +33,10 @@ jobs:
pipenv run noaawildfires hms-smoke > data/hms-smoke.json
shell: bash

- name: Datestamp
run: date > data/timestamp.txt
shell: bash

- id: commit
name: Commit results
run: |
Expand All @@ -35,6 +45,6 @@ jobs:
git config pull.rebase false
git status
git pull origin $GITHUB_REF
git add ./
git add ./data
git commit -m "Scrape" && git push || true
shell: bash
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,29 +13,29 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.12.1
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black]

- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py37-plus]
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setuptools-scm = "*"
pre-commit = "*"
sphinx = "*"
myst-parser = "*"
sphinx-palewire-theme = "*"

[packages]
fiona = "*"
Expand All @@ -18,4 +19,4 @@ geojson = "*"
requests = "*"

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

0 comments on commit 824a575

Please sign in to comment.