Skip to content

Commit 79e7a01

Browse files
committed
Using the script to determine which backend server to use for main branch deploys. Also caches the build to keep things coherent.
1 parent 40696dd commit 79e7a01

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/deploy-main.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@ name: Publish Test Page
33
on:
44
push:
55
branches:
6-
- main
6+
- develop
7+
- r/*.x
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
1011
cancel-in-progress: true
1112

1213
jobs:
14+
detect:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: determine the correct test server
18+
run: echo "TEST_SERVER=`./.github/get-release-server.sh`" >> GITHUB_ENV
19+
1320
build:
1421
if: github.repository_owner == 'opencast'
22+
needs: detect
1523
runs-on: ubuntu-latest
1624
steps:
1725
- name: checkout code
@@ -28,15 +36,22 @@ jobs:
2836
- name: build project
2937
env:
3038
NODE_ENV: development
31-
VITE_TEST_SERVER_URL: "https://develop.opencast.org"
39+
VITE_TEST_SERVER_URL: ${{ TEST_SERVER }}
3240
VITE_TEST_SERVER_AUTH: "admin:opencast"
3341
run: npm run build
3442

43+
- name: restore cache
44+
id: cache-builds
45+
run: actions/cache/restore@v4
46+
with:
47+
path: gh-pages
48+
id: gh-pages
49+
3550
- name: create pages directory
36-
run: mkdir gh-pages
51+
run: mkdir -p gh-pages
3752

3853
- name: include admin interface
39-
run: mv build gh-pages/admin-ui
54+
run: mv build gh-pages/${{ github.ref }}/admin-ui
4055

4156
- name: include landing page
4257
run: cp .github/demo-page.html gh-pages/index.html
@@ -46,6 +61,12 @@ jobs:
4661
with:
4762
path: ./gh-pages
4863

64+
- name: cache built artifacts
65+
uses: actions/cache@v4
66+
with:
67+
path: gh-pages
68+
id: gh-pages
69+
4970
deploy:
5071
if: github.repository_owner == 'opencast'
5172
needs: build

0 commit comments

Comments
 (0)