mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-30 20:24:25 +00:00
feat(ci): build web docker images
[platform:web]
This commit is contained in:
13
.dockerignore
Normal file
13
.dockerignore
Normal file
@@ -0,0 +1,13 @@
|
||||
.git/
|
||||
.dart_tool/
|
||||
android/
|
||||
build/
|
||||
docs/
|
||||
ios/
|
||||
linux/
|
||||
localization/
|
||||
macos/
|
||||
node_modules/
|
||||
shaders/
|
||||
snap/
|
||||
windows/
|
||||
@@ -1,5 +0,0 @@
|
||||
root: ./docs
|
||||
|
||||
structure:
|
||||
readme: README.md
|
||||
summary: SUMMARY.md
|
||||
@@ -11,6 +11,14 @@ inputs:
|
||||
description: 'App Store Connect API Key'
|
||||
required: false
|
||||
default: ''
|
||||
ghcr-actor:
|
||||
description: 'GitHub Container Registry Actor'
|
||||
required: false
|
||||
default: ''
|
||||
ghcr-token:
|
||||
description: 'GitHub Container Registry Token'
|
||||
required: false
|
||||
default: ''
|
||||
google-play-key:
|
||||
description: 'Google Play Store API Key'
|
||||
required: false
|
||||
@@ -52,6 +60,18 @@ runs:
|
||||
with:
|
||||
xcode-version: latest-stable
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
if: ${{ inputs.channel == 'docker' }}
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Setup GitHub Package Registry
|
||||
if: ${{ inputs.channel == 'docker' }}
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ inputs.ghcr-actor }}
|
||||
password: ${{ inputs.ghcr-token }}
|
||||
|
||||
- name: Setup Secret Keys
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
59
.github/workflows/build_web.yml
vendored
59
.github/workflows/build_web.yml
vendored
@@ -6,14 +6,17 @@ on:
|
||||
build-number:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
FIREBASE_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-canvaskit:
|
||||
name: CanvasKit
|
||||
build-hosted:
|
||||
name: Hosted
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
@@ -28,5 +31,55 @@ jobs:
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: web-canvaskit
|
||||
name: web-hosted
|
||||
path: ${{ github.workspace }}/build/web
|
||||
|
||||
build-archive:
|
||||
name: Archive
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master
|
||||
with:
|
||||
platform: web
|
||||
|
||||
- name: Build LunaSea
|
||||
run: npm run build:web
|
||||
|
||||
- name: Create Archive
|
||||
uses: thedoctor0/zip-release@0.6.2
|
||||
with:
|
||||
type: zip
|
||||
filename: output/lunasea-web-canvaskit.zip
|
||||
directory: ${{ github.workspace }}/build/web
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: web-archive
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
build-docker:
|
||||
name: Docker
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_build@master
|
||||
with:
|
||||
platform: web
|
||||
|
||||
- name: Build LunaSea
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
outputs: type=docker,dest=${{ github.workspace}}/output/lunasea-web-docker.tar
|
||||
tags: |
|
||||
ghcr.io/jagandeepbrar/lunasea:latest
|
||||
ghcr.io/jagandeepbrar/lunasea:${{ inputs.flavor }}
|
||||
ghcr.io/jagandeepbrar/lunasea:${{ github.sha }}
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: web-docker
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
35
.github/workflows/publish.yml
vendored
35
.github/workflows/publish.yml
vendored
@@ -183,6 +183,32 @@ jobs:
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} pkg:${{ github.workspace }}/output/lunasea-macos-amd64.pkg
|
||||
|
||||
web-docker:
|
||||
name: Docker
|
||||
if: ${{ inputs.enable-web == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: docker
|
||||
ghcr-actor: ${{ github.actor }}
|
||||
ghcr-token: ${{ github.token }}
|
||||
|
||||
- name: Download Docker Image
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-docker
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Load Docker Image
|
||||
run: |
|
||||
docker load --input ${{ github.workspace}}/output/lunasea-web-docker.tar
|
||||
docker image ls -a
|
||||
|
||||
- name: Deploy to GitHub Container Registry
|
||||
run: docker image push --all-tags ghcr.io/jagandeepbrar/lunasea
|
||||
|
||||
web-netlify:
|
||||
name: Netlify
|
||||
if: ${{ inputs.enable-web == 'true' }}
|
||||
@@ -196,7 +222,7 @@ jobs:
|
||||
- name: Download Web Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-canvaskit
|
||||
name: web-hosted
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Determine Release Channel
|
||||
@@ -278,6 +304,13 @@ jobs:
|
||||
name: windows-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download Web Archive
|
||||
if: ${{ inputs.enable-web == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-archive
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download Windows MSIX Installer
|
||||
if: ${{ inputs.enable-windows == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@@ -99,6 +99,7 @@ jobs:
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/build_web.yml@master
|
||||
with:
|
||||
build-number: ${{ needs.prepare.outputs.build-number }}
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
secrets:
|
||||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
||||
|
||||
|
||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
# Build
|
||||
FROM debian:latest as build
|
||||
|
||||
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:$PATH"
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y curl git wget unzip
|
||||
RUN apt-get clean
|
||||
|
||||
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
|
||||
RUN flutter channel stable
|
||||
RUN flutter upgrade
|
||||
|
||||
RUN mkdir /lunasea/
|
||||
COPY . /lunasea/
|
||||
WORKDIR /lunasea/
|
||||
RUN flutter build web
|
||||
|
||||
# Runtime
|
||||
FROM nginx:alpine
|
||||
LABEL org.opencontainers.image.source="https://github.com/JagandeepBrar/LunaSea"
|
||||
COPY --from=build /lunasea/build/web /usr/share/nginx/html
|
||||
@@ -29,6 +29,17 @@ extension StringExtension on String {
|
||||
|
||||
return split.join(_wordDelimiter);
|
||||
}
|
||||
|
||||
Future<void> copyToClipboard({
|
||||
bool showSnackBar = true,
|
||||
}) async {
|
||||
await Clipboard.setData(ClipboardData(text: this));
|
||||
if (showSnackBar)
|
||||
showLunaSuccessSnackBar(
|
||||
title: 'Copied',
|
||||
message: 'Copied content to the clipboard',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension StringLinksExtension on String {
|
||||
@@ -90,15 +101,4 @@ extension StringLinksExtension on String {
|
||||
/// Attach this string as a series ID to TVMaze and attempt to launch it as a URL.
|
||||
Future<void> lunaOpenTVMaze() async =>
|
||||
await _openLink('https://www.tvmaze.com/shows/$this');
|
||||
|
||||
Future<void> copyToClipboard({
|
||||
bool showSnackBar = true,
|
||||
}) async {
|
||||
await Clipboard.setData(ClipboardData(text: this));
|
||||
if (showSnackBar)
|
||||
showLunaSuccessSnackBar(
|
||||
title: 'Copied',
|
||||
message: 'Copied content to the clipboard',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user