Skip to content

Commit

Permalink
Update github workflows:
Browse files Browse the repository at this point in the history
- Removed '-' from workflow filename
- Build & release backend in separate workflow triggered by tag
  • Loading branch information
vjf committed Oct 25, 2024
1 parent c8760e5 commit 42bcd70
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,48 +143,3 @@ jobs:
name: geomodels-${{matrix.model_name}}-web-assets.tar.gz
path: web_build/geomodels-${{matrix.model_name}}-web-assets.tar.gz
if-no-files-found: error
build_backend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install PDM
run: |
python -m pip install --upgrade pip
pip install pdm
- name: Install dependencies
run: |
# Remove old venv
pdm venv remove -y for-backend-build 2>/dev/null || pdm venv list
# Create new venv
pdm venv create --with-pip --name for-backend-build 3.10
eval $(pdm venv activate for-backend-build)
pdm install --venv for-backend-build
- name: Make boreholes
run: |
eval $(pdm venv activate for-backend-build)
pushd web_build
./make_boreholes.py -b batch.txt -d query_data.db boreholes
tar cvfz boreholes.tar.gz ./boreholes
popd
- name: Upload borehole data
uses: actions/upload-artifact@v4
with:
name: boreholes.tar.gz
path: web_build/boreholes.tar.gz
if-no-files-found: error
- name: Make API directory
run: |
pushd web_build
./build_api_dir.sh boreholes/query_data.db
popd
- name: Upload API directory
uses: actions/upload-artifact@v4
with:
name: api.tar.gz
path: web_build/api.tar.gz
if-no-files-found: error
26 changes: 26 additions & 0 deletions .github/workflows/release_backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Release backend from the latest successful build action into a certain release
name: Release backend api and borehole db

on:
push:
tags:
- "PORTAL_RELEASE_*"

jobs:
do-release:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build_backend.yml
workflow_conclusion: success
branch: master
- name: Add to release
uses: softprops/action-gh-release@v2
with:
name: Source and web asset release based on tag ${{github.ref}}
files: |
api.tar.gz
boreholes.tar.gz
fail_on_unmatched_files: true
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-models.yml
workflow: build_models.yml
workflow_conclusion: success
branch: master
- name: Add to release
Expand Down

0 comments on commit 42bcd70

Please sign in to comment.