From 513f23b02f8d93d5a123ea48a8d8c32671cb704b Mon Sep 17 00:00:00 2001 From: Ville Tuulos Date: Tue, 21 Jan 2025 01:53:31 +0000 Subject: [PATCH] improve pipeline --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ weathervizflow.py | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..73fd040 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Run HelloWorld Flow +on: + push: + +jobs: + helloworld: + permissions: + id-token: write + contents: read + + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 + + - name: Install and Configure Outerbounds + run: |- + python -m pip install -U outerbounds && \ + outerbounds service-principal-configure \ + --name weather-cicd \ + --deployment-domain dev-content.outerbounds.xyz \ + --perimeter default \ + --github-actions + + - name: Deploy workflows + run: |- + ./deploy diff --git a/weathervizflow.py b/weathervizflow.py index 39dbc35..521ecb7 100644 --- a/weathervizflow.py +++ b/weathervizflow.py @@ -23,13 +23,13 @@ class WeatherVizFlow(BaseFlow): def start(self): self.timestamp = self.sensor_value print("Querying data for", self.timestamp) - latest_weather = self.query_snowflake( + self.latest_weather = self.query_snowflake( template=("bay_weather", [self.timestamp]) ) current.card.append( Markdown(f"# Temperatures in the Bay Area at {self.timestamp}") ) - current.card.append(make_vegachart(latest_weather)) + current.card.append(make_vegachart(self.latest_weather)) self.next(self.end) @step