Convert server status endpoint to ninja (#234) #177
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
name: CD | |
on: | |
push: | |
branches: | |
- "main" | |
concurrency: | |
# Only run the latest workflow. | |
# If a build is already happening, cancel it to avoid a race | |
# condition where an older image overwrites a newer one. | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build [rdwatch] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Sanitize repo slug | |
uses: actions/github-script@v6 | |
id: repo-slug | |
with: | |
result-encoding: string | |
script: return 'ghcr.io/${{ github.repository }}'.toLowerCase() | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.repo-slug.outputs.result }}/rdwatch:latest | |
publish-cli: | |
name: Build [rdwatch-cli] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install system dependencies | |
run: apt-fast install --no-install-recommends --yes | |
libgdal30 | |
libproj22 | |
python3-cachecontrol | |
python3-dev | |
python3-poetry | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "poetry" | |
cache-dependency-path: "cli/poetry.lock" | |
- name: Build rdwatch-cli | |
run: poetry build | |
working-directory: cli | |
- name: Make package index | |
uses: girder/create-pip-index-action@main | |
with: | |
package_directory: cli/dist/ | |
- name: Deploy to GH Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: cli/dist/ |