aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-05-26 10:48:43 +0200
committerAriel Costas Guerrero <ariel@costas.dev>2025-05-26 10:48:43 +0200
commit5ced7f916d94e86e9a7ec164bee56f9a8e3a2a3a (patch)
treeb1ef5afa17b4a2f9fb2cbd683afc2fb6d905b5e1 /.github/workflows
parent4637373b50636e78dc2c7b6f99be879edb4ff7dc (diff)
Replace Azure SWA with custom server
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/deploy.yml33
-rw-r--r--.github/workflows/update-stops-data.yml13
2 files changed, 7 insertions, 39 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
deleted file mode 100644
index 02b52ce..0000000
--- a/.github/workflows/deploy.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Azure Static Web Apps CI/CD
-
-on:
- push:
- branches:
- - main
-
-jobs:
- build_and_deploy_job:
- runs-on: ubuntu-latest
- environment: Production
- name: Build and Deploy Job
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true
- lfs: false
- - uses: actions/setup-node@v4.2.0
- with:
- node-version: '22'
- cache: 'npm'
- - name: Install dependencies
- run: npm ci
- - name: Build And Deploy
- id: builddeploy
- uses: Azure/static-web-apps-deploy@v1
- with:
- azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_GLACIER_064358D03 }}
- repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
- action: "upload"
- app_location: "/" # App source code path
- api_location: "./Backend" # Api source code path - optional
- output_location: "dist" # Built app content directory - optional \ No newline at end of file
diff --git a/.github/workflows/update-stops-data.yml b/.github/workflows/update-stops-data.yml
index 8e0def9..5a1ace3 100644
--- a/.github/workflows/update-stops-data.yml
+++ b/.github/workflows/update-stops-data.yml
@@ -14,10 +14,10 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
-
+
- name: Run download script
run: uv run data/download-stops.py
-
+
- name: Commit changes if any
id: commit
run: |
@@ -36,7 +36,7 @@ jobs:
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "changes_made=true" >> $GITHUB_OUTPUT
fi
-
+
- name: Create Pull Request
if: steps.commit.outputs.changes_made == 'true'
env:
@@ -45,19 +45,20 @@ jobs:
run: |
# Close any existing PRs created by this action
existing_prs=$(gh pr list --json number,title,headRefName --search "Update stops data in:title head:update-stops-data- author:app/github-actions is:open")
-
+
if [[ $(echo "$existing_prs" | jq length) -gt 0 ]]; then
echo "Found existing PRs to close"
echo "$existing_prs" | jq -c '.[]' | while read pr; do
pr_number=$(echo "$pr" | jq -r '.number')
echo "Closing PR #$pr_number"
gh pr close $pr_number --comment "Superseded by a new PR with updated data"
+ gh branch delete $(echo "$pr" | jq -r '.headRefName') --force
done
fi
-
+
# Create new PR
gh pr create \
--title "Update stops data" \
--body "Automatically generated PR with updated stops data from scheduled fetch." \
--base main \
- --head "$BRANCH_NAME" \ No newline at end of file
+ --head "$BRANCH_NAME"