improve seo #258
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 web app | |
on: | |
push: | |
branches: main | |
jobs: | |
build-apk: | |
name: "[frontend] Android build" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./tarok | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: "12.x" | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Set version number | |
run: sed -i "s/RELEASE = \"DEBUG\"/RELEASE = \"${GITHUB_SHA}\"/g" lib/constants.dart | |
- name: Set key.properties | |
env: | |
PROPERTIES_PATH: "./android/key.properties" | |
run: | | |
echo keyPassword=\${{ secrets.KEY_STORE }} > ${{env.PROPERTIES_PATH}} | |
echo storePassword=\${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}} | |
echo storeFile=key.jks >> ${{env.PROPERTIES_PATH}} | |
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}} | |
- name: Decode the keystore | |
run: echo "${{ secrets.KEYSTORE2 }}" | base64 --decode > android/app/key.jks | |
- name: Upgrade packages | |
run: flutter pub upgrade | |
- name: Build the APK | |
run: flutter build apk --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: android_app | |
path: tarok/build/app/outputs/apk/release/app-release.apk | |
build-windows: | |
name: "[frontend] Windows build" | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./tarok | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- run: git config --system core.longpaths true && flutter pub upgrade | |
- run: flutter pub get | |
- run: flutter config --enable-windows-desktop | |
- run: flutter doctor --verbose | |
- run: flutter devices | |
- run: flutter build windows --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: windows_app | |
path: tarok/build/windows/x64/runner/Release | |
build-linux: | |
name: "[frontend] Linux build" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./tarok | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev libjsoncpp-dev libmpv-dev mpv | |
- name: Set version number | |
run: sed -i "s/RELEASE = \"DEBUG\"/RELEASE = \"${GITHUB_SHA}\"/g" lib/constants.dart | |
- name: Get dependencies | |
run: flutter pub upgrade | |
- name: Enable Linux desktop for building | |
run: flutter config --enable-linux-desktop | |
- name: Run flutter doctor for inspection | |
run: flutter doctor -v | |
- name: Run flutter devices for getting all devices info | |
run: flutter devices | |
- name: Build Linux app | |
run: flutter build linux --verbose | |
- run: ls build/linux/x64/release/bundle | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: linux_app | |
path: tarok/build/linux/x64/release/bundle | |
build-web: | |
name: "[frontend] JavaScript build" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./tarok | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Set version number | |
run: sed -i "s/RELEASE = \"DEBUG\"/RELEASE = \"${GITHUB_SHA}\"/g" lib/constants.dart | |
- run: flutter pub upgrade | |
- run: flutter build web --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: web_app | |
path: tarok/build/web | |
build-web-docker: | |
name: "[frontend] JavaScript container build" | |
needs: build-web | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Docker version | |
run: docker --version | |
- name: Docker Login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
registry: "ghcr.io" | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
file: "./tarok/Dockerfile" | |
tags: ghcr.io/mytja/tarok/frontend:latest | |
push: true | |
stockskis-cli-linux: | |
name: "[stockskis_cli] Linux build" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./stockskis_cli | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Pull StockŠkis dependencies | |
run: dart pub get | |
- name: Build StockŠkis & StockŠkis CLI | |
run: ./build.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: stockskis-cli-linux | |
path: backend/stockskis | |
server-build-linux: | |
name: "[backend] Linux build" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: "^1.20" | |
- name: Install packages | |
run: sudo apt update -y && sudo apt install -y libvips-dev libvips | |
- name: Get current Go version | |
run: go version | |
- name: Get Go dependencies | |
run: go mod download | |
- name: Set env | |
run: go env -w GOFLAGS=-mod=mod | |
- name: Build app | |
run: go build -v -o backend . | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: backend-linux | |
path: backend/backend | |
server-docker: | |
name: "[backend] Linux container build" | |
needs: | |
- server-build-linux | |
- stockskis-cli-linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: List files | |
run: ls -la | |
- name: Get Docker version | |
run: docker --version | |
- name: Docker Login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
registry: "ghcr.io" | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
file: "./backend/Dockerfile" | |
tags: ghcr.io/mytja/tarok/backend:latest | |
push: true |