Skip to content

Update cordova-hugo.yml #17

Update cordova-hugo.yml

Update cordova-hugo.yml #17

Workflow file for this run

name: Deploy Hugo site to Pages and Build Cordova APK
on:
push:
branches: ["gradle"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
mobagenie/buildmlbb \
bash -c "
cd /workspace &&
hugo --minify --baseURL '${{ steps.pages.outputs.base_url }}/'
"
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
# Cordova build job
cordova_build:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Build Cordova with Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
mobagenie/buildmlbb \
bash -c "
cd /workspace &&
cordova create cordova-app com.example.app MyApp &&
rm -rf cordova-app/www &&
cp -r public/* cordova-app/www &&
cd cordova-app &&
cordova platform add android &&
cordova build android --release
"
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: MyApp-release.apk
path: cordova-app/platforms/android/app/build/outputs/apk/release/app-release.apk
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4