host the web client on gh pages #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build client | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
cache-dependency-path: mapkom_client/yarn.lock | |
- name: Install dependencies | |
run: yarn install | |
working-directory: mapkom_client | |
- name: Run Expo prebuild | |
run: yarn expo prebuild | |
working-directory: mapkom_client | |
- name: Set Up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
cache: "gradle" | |
- name: Change Gradle wrapper permissions | |
run: chmod +x ./gradlew | |
working-directory: mapkom_client/android | |
- name: Build Gradle project | |
run: ./gradlew assembleRelease | |
working-directory: mapkom_client/android | |
- name: Upload APK Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: android-release | |
path: mapkom_client/android/app/build/outputs/apk/release/app-release.apk | |
build-web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "yarn" | |
cache-dependency-path: mapkom_client/yarn.lock | |
- name: Install dependencies | |
run: yarn install | |
working-directory: mapkom_client | |
- name: Run Expo export | |
run: yarn expo export -p web | |
working-directory: mapkom_client | |
- name: Upload built static files as an artifact | |
id: web-release | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: build_outputs_folder/ | |
deploy-web: | |
needs: build-web | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy web client to GitHub Pages | |
id: web-release | |
uses: actions/deploy-pages@v4 |