re-write the dependency installations and rely on vcpkg on GHA #54
This file contains hidden or 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: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
useCache: | |
description: Use GHA cache | |
type: boolean | |
required: false | |
default: true | |
push: | |
branches: | |
- "valhalla_python" | |
- "osrm_python" | |
paths-ignore: | |
- '*.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build_manylinux: | |
name: manylinux_2_28_x86_64 | |
runs-on: ubuntu-22.04 | |
env: | |
POLICY: manylinux_2_28 | |
PLATFORM: x86_64 | |
COMMIT_SHA: ${{ github.sha }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Restore cache | |
if: github.event_name != 'workflow_dispatch' || fromJSON(github.event.inputs.useCache) | |
uses: actions/cache/restore@v4 | |
with: | |
path: .buildx-cache-manylinux_2_28_x86_64/ | |
key: buildx-cache-manylinux_2_28_x86_64-${{ hashFiles('docker/**') }} | |
restore-keys: buildx-cache-manylinux_2_28_x86_64- | |
- name: Get branch name | |
run: | | |
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Build image | |
run: ./build.sh | |
- name: Delete cache | |
if: github.event_name == 'push' && github.ref == 'refs/heads/valhalla_python' | |
run: | | |
KEY="buildx-cache-manylinux_2_28_x86_64-${{ hashFiles('docker/**') }}" | |
gh cache delete ${KEY} || true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Save cache | |
if: github.event_name == 'push' && github.ref == 'refs/heads/valhalla_python' | |
uses: actions/cache/save@v4 | |
with: | |
path: .buildx-cache-manylinux_2_28_x86_64/ | |
key: buildx-cache-manylinux_2_28_x86_64-${{ hashFiles('docker/**') }} | |
- name: Push image | |
run: | | |
docker tag quay.io/pypa/manylinux_2_28_x86_64:${{ github.sha }} ghcr.io/gis-ops/manylinux:2_28_${{ env.BRANCH }} | |
docker image rm quay.io/pypa/manylinux_2_28_x86_64:${{ github.sha }} | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
docker push ghcr.io/gis-ops/manylinux:2_28_${{ env.BRANCH }} |