forked from uwescience/GitHubActionsTutorial-USRSE24
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 2.51 KB
/
image_correlation_pair.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Process a single image pair
name: image_correlation_pair
run-name: ${{ inputs.workflow_name }}
# Set workflow input parameters and defaults
on:
workflow_dispatch:
inputs:
img1_product_name:
type: string
required: true
description: S2 image 1 product name
default: S2A_MSIL2A_20200629T054641_N0500_R048_T43SEA_20230505T184918.SAFE
img2_product_name:
type: string
required: true
description: S2 image 2 product name
default: S2B_MSIL2A_20200922T054639_N0500_R048_T43SEA_20230624T184729.SAFE
workflow_name:
description: 'Custom workflow name'
required: false
default: 'autoRIFT'
type: string
# Must duplicate inputs for workflow_call (https://github.com/orgs/community/discussions/39357)
workflow_call:
inputs:
img1_product_name:
type: string
description: S2 image 1 product name
img2_product_name:
type: string
description: S2 image 2 product name
workflow_name:
description: 'Custom workflow name'
type: string
jobs:
autoRIFT:
name: ${{ inputs.workflow_name }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
cache-environment: true
environment-file: glacier_image_correlation/environment.yml
- name: Modify autoRIFT Package
# current release has deprecated numpy functions https://github.com/nasa-jpl/autoRIFT/issues/97
run: |
git clone https://github.com/gbrencher/autoRIFT.git
cp -f autoRIFT/geo_autoRIFT/autoRIFT/autoRIFT.py /home/runner/micromamba/envs/image-correlation/lib/python3.12/site-packages/autoRIFT/
- name: Download Data and Run autoRIFT Software
run: |
python glacier_image_correlation/image_correlation.py ${{ inputs.img1_product_name }} ${{ inputs.img2_product_name }}
- name: Upload Velocity Map as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.workflow_name }}
path: |
S2*horizontal_velocity.tif