-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from kudos-ink/create-manual-import-workflow
feat: add manually triggered import workflow
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Manually trigger the import | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
json_file: | ||
description: 'Path to the initial JSON file' | ||
required: true | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install Cargo Lambda with pip3 | ||
run: | | ||
pip3 install cargo-lambda | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Generate import payload | ||
run: | | ||
cargo run -p generate_import_payload -- ${{ github.event.inputs.json_file }} | ||
|
||
- name: Invoke remote lambda function | ||
run: | | ||
cd src/import | ||
FILE_NAME=$(basename "${{ github.event.inputs.json_file }}") | ||
cargo lambda invoke --remote gh-import-issues --region us-east-1 --data-file payloads/$FILE_NAME |