Skip to content

Commit 9d35b86

Browse files
committed
Deploy in preview namesspace
1 parent 8b6169b commit 9d35b86

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/preview-web-down.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
echo "skip=false" >> $GITHUB_OUTPUT
3434
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
3535
echo "release=$SLUG" >> $GITHUB_OUTPUT
36-
echo "namespace=preview-$SLUG" >> $GITHUB_OUTPUT
36+
# shared namespace for all previews; only the release is per-branch
37+
echo "namespace=preview" >> $GITHUB_OUTPUT
3738
echo "host=$SLUG.ohmstaging.org" >> $GITHUB_OUTPUT
3839
3940
- uses: actions/checkout@v4
@@ -72,8 +73,10 @@ jobs:
7273
done
7374
echo "Tunnel failed to reach k3s" >&2; exit 1
7475
75-
- name: Helm uninstall + delete namespace
76+
# Uninstall only this branch's release. The shared `preview` namespace and
77+
# its middleware stay (other previews live there).
78+
- name: Helm uninstall
7679
if: steps.r.outputs.skip != 'true'
7780
run: |
7881
helm -n ${{ steps.r.outputs.namespace }} uninstall ${{ steps.r.outputs.release }} || echo "release already gone"
79-
kubectl delete namespace ${{ steps.r.outputs.namespace }} --ignore-not-found
82+
kubectl -n ${{ steps.r.outputs.namespace }} delete job ${{ steps.r.outputs.release }}-restore --ignore-not-found

.github/workflows/preview-web-up.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ jobs:
3939
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
4040
echo "slug=$SLUG" >> $GITHUB_OUTPUT
4141
echo "release=$SLUG" >> $GITHUB_OUTPUT
42-
echo "namespace=preview-$SLUG" >> $GITHUB_OUTPUT
42+
# one shared namespace for all previews; each branch is its own release
43+
echo "namespace=preview" >> $GITHUB_OUTPUT
4344
echo "host=$SLUG.ohmstaging.org" >> $GITHUB_OUTPUT
4445
4546
- uses: actions/checkout@v4

values.k3s.preview.template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ osm-seed:
2929
MAILER_USERNAME: "{{MAILER_USERNAME}}"
3030
MAILER_PASSWORD: "{{MAILER_PASSWORD}}"
3131
MAILER_FROM: web@noreply.openhistoricalmap.org
32-
NOMINATIM_URL: nominatim.ohmstaging.org
33-
OVERPASS_URL: overpass-api.ohmstaging.org
32+
NOMINATIM_URL: nominatim.openhistoricalmap.org
33+
OVERPASS_URL: overpass-api.openhistoricalmap.org
3434
NEW_RELIC_LICENSE_KEY: "none"
3535
NEW_RELIC_APP_NAME: "none"
3636
ORGANIZATION_NAME: OpenHistoricalMap

0 commit comments

Comments
 (0)