Compare commits
2 Commits
build-ad3b
...
build-6090
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60909913a5 | ||
|
|
cbf7d08f6a |
@@ -5,7 +5,7 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-android:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
@@ -48,7 +48,6 @@ jobs:
|
||||
--platform=android \
|
||||
--profile=preview
|
||||
|
||||
# Neuer Schritt: Rename das Binary, damit es wie eine echte App aussieht
|
||||
- name: 📝 Rename build to APK
|
||||
run: mv app-build app-release.apk
|
||||
|
||||
@@ -59,6 +58,62 @@ jobs:
|
||||
path: app-release.apk
|
||||
if-no-files-found: error
|
||||
|
||||
build-web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: 🏗 Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: 🏗 Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: 🏗 Setup Expo and EAS
|
||||
uses: expo/expo-github-action@v8
|
||||
with:
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
eas-version: latest
|
||||
packager: pnpm
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: 👷 Build web
|
||||
run: npx expo export --platform web
|
||||
|
||||
- name: 📦 Zip dist
|
||||
run: cd dist && zip -r ../dist.zip .
|
||||
|
||||
- name: 📤 Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: web-build
|
||||
path: dist.zip
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android, build-web]
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: 📥 Download Android artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android-preview-build
|
||||
|
||||
- name: 📥 Download Web artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-build
|
||||
|
||||
- name: 🏷 Create tag
|
||||
run: |
|
||||
TAG="build-$(git rev-parse --short HEAD)"
|
||||
@@ -71,7 +126,9 @@ jobs:
|
||||
with:
|
||||
tag_name: ${{ env.RELEASE_TAG }}
|
||||
name: ${{ env.RELEASE_TAG }}
|
||||
files: app-release.apk
|
||||
files: |
|
||||
app-release.apk
|
||||
dist.zip
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
8
docker-compose.yml
Normal file
8
docker-compose.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
services:
|
||||
web:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "45554:80"
|
||||
volumes:
|
||||
- ./entrypoint.sh:/entrypoint.sh:ro
|
||||
entrypoint: ["/bin/sh", "/entrypoint.sh"]
|
||||
29
entrypoint.sh
Normal file
29
entrypoint.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
WEBROOT="/usr/share/nginx/html"
|
||||
GITEA_URL="https://gitea.reversed.dev"
|
||||
GITEA_REPO="space/time-until"
|
||||
|
||||
echo "Fetching latest release"
|
||||
|
||||
RELEASE_JSON=$(wget -qO- \
|
||||
"$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/latest")
|
||||
|
||||
ASSET_URL=$(echo "$RELEASE_JSON" | sed -n 's/.*"browser_download_url" *: *"\([^"]*dist\.zip[^"]*\)".*/\1/p' | head -1)
|
||||
|
||||
if [ -z "$ASSET_URL" ]; then
|
||||
echo "ERROR: No dist.zip found in latest release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Downloading $ASSET_URL ..."
|
||||
wget -qO /tmp/dist.zip --header="$AUTH_HEADER" "$ASSET_URL"
|
||||
|
||||
echo "Extracting to $WEBROOT ..."
|
||||
rm -rf "${WEBROOT:?}"/*
|
||||
unzip -o /tmp/dist.zip -d "$WEBROOT"
|
||||
rm /tmp/dist.zip
|
||||
|
||||
echo "Starting nginx ..."
|
||||
exec nginx -g "daemon off;"
|
||||
Reference in New Issue
Block a user