Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hotosm/osm-rawdata
Browse files Browse the repository at this point in the history
SYn with upstream.
  • Loading branch information
rsavoye committed Sep 3, 2023
2 parents 3251650 + 0ee21ca commit e5fe0f9
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 35 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build CI Img

on:
# Push includes PR merge
push:
branches:
- main
paths:
# Workflow is triggered only if deps change
- "pyproject.toml"
- "Dockerfile"
# Allow manual trigger
workflow_dispatch:

env:
REGISTRY: ghcr.io
GIT_BRANCH: ${{ github.ref_name }}

jobs:
build-and-push-images:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref_name }}
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version
id: extract_api_version
run: |
echo "PKG_VERSION=$(python -c 'from osm_rawdata.__version__ import __version__; print(__version__)')" >> $GITHUB_ENV
- name: Build image
uses: docker/build-push-action@v4
with:
context: .
target: ci
push: true
tags: |
"ghcr.io/hotosm/osm-rawdata:${{ env.PKG_VERSION }}-ci"
"ghcr.io/hotosm/osm-rawdata:ci"
build-args: |
PKG_VERSION=${{ env.PKG_VERSION }}
18 changes: 6 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: Build and Deploy
name: Build

on:
# Push includes PR merge
push:
branches:
- main
paths:
# Workflow is triggered only if src changes
- "src/**"
release:
types: [published]
# Allow manual trigger
workflow_dispatch:

Expand Down Expand Up @@ -38,8 +33,7 @@ jobs:
- name: Extract version
id: extract_api_version
run: |
cd src/backend
echo "PKG_VERSION=$(python -c 'from app.__version__ import __version__; print(__version__)')" >> $GITHUB_ENV
echo "PKG_VERSION=$(python -c 'from osm_rawdata.__version__ import __version__; print(__version__)')" >> $GITHUB_ENV
- name: Build image
uses: docker/build-push-action@v4
Expand All @@ -48,7 +42,7 @@ jobs:
target: prod
push: true
tags: |
"ghcr.io/hotosm/fmtm/osm-fieldwork:${{ env.PKG_VERSION }}"
"ghcr.io/hotosm/fmtm/osm-fieldwork:latest"
"ghcr.io/hotosm/osm-rawdata:${{ env.PKG_VERSION }}"
"ghcr.io/hotosm/osm-rawdata:latest"
build-args: |
PKG_VERSION=${{ env.PKG_VERSION }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ NEWS
*.app

# PDM
.pdm.toml
pdm.toml
.pdm-python
__pypackages__

# Python builds
build
dist

# Docs
site
.cache
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ To install osm-rawdata, you can use pip. Here are two options:
Run a specific command:

```bash
docker run --rm -v $PWD:/data ghcr.io/hotosm/osm-rawdata:0.1.0 osm-rawdata
docker run --rm -v $PWD:/data ghcr.io/hotosm/osm-rawdata:latest geofabrik <flags>
```

Run interactively (to use multiple commands):

```bash
docker run --rm -it -v $PWD:/data ghcr.io/hotosm/osm-rawdata:0.1.0
docker run --rm -it -v $PWD:/data ghcr.io/hotosm/osm-rawdata:latest
```

> Note: the output directory should always be /data/... to persist data.
Expand Down
19 changes: 0 additions & 19 deletions build_imgs.sh

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ version = "0.1.0"
version_files = [
"pyproject.toml:version",
"osm_rawdata/__version__.py",
"build_imgs.sh:PKG_VERSION",
]

[tool.pdm]
Expand Down

0 comments on commit e5fe0f9

Please sign in to comment.