Skip to content

Commit

Permalink
generate and deploy same ci-cd wflow
Browse files Browse the repository at this point in the history
one workflow file to generate the ttls, and deploy the files to the
server
  • Loading branch information
tngTUDOR committed Oct 10, 2024
1 parent e233d07 commit 330fbd5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/generation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ jobs:
- name: generate
run: |
sh scripts/generate.sh
deploy_to_server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: deploy
uses: mdallasanta/[email protected]
with:
host: ${{ secrets.HOST }}
user: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
local: 'sentier_vocab/output/'
remote: sentier_vocab
scp_options: -r
16 changes: 11 additions & 5 deletions sentier_vocab/custom_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
from sentier_vocab.input.custom_products import CUSTOM_PRODUCTS_DATA

created_ttls = []


def add_custom_products():
out_file = add_custom_terms(CUSTOM_PRODUCTS_DATA, "https://vocab.sentier.dev/products/", "custom-products")
created_ttls.append({"graph": "https://vocab.sentier.dev/products/",
"ttl_file": str(out_file.name)})
out_file = add_custom_terms(
CUSTOM_PRODUCTS_DATA, "https://vocab.sentier.dev/products/", "custom-products"
)
created_ttls.append(
{"graph": "https://vocab.sentier.dev/products/", "ttl_file": str(out_file.name)}
)
logger.info(f"Added {out_file} to outputs")



if __name__ == "__main__":
add_custom_products()
with Path("new_ttls.json").open(mode="w", encoding="utf-8") as f:
with Path(Path(__file__).parent / "output" / "new_ttls.json").open(
mode="w", encoding="utf-8"
) as f:
f.write(json.dumps(created_ttls, indent=2))

0 comments on commit 330fbd5

Please sign in to comment.