mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
update workflows.
This commit is contained in:
@@ -2,12 +2,16 @@ name: Build and Publish Client Artifacts
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
#pull_request: # Change to push when ready to deploy
|
inputs:
|
||||||
# branches:
|
with-artifact:
|
||||||
# - master
|
required: false
|
||||||
# paths:
|
type: boolean
|
||||||
# - client/**
|
default: true
|
||||||
# - .github/workflows/client_build.yml
|
description: |
|
||||||
|
If true, the build artifacts will be uploaded as a GitHub Actions artifact.
|
||||||
|
This is useful for debugging and testing purposes. If false, the artifacts
|
||||||
|
will not be uploaded. This is useful for test builds where you don't need
|
||||||
|
the artifacts.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
client_build:
|
client_build:
|
||||||
@@ -35,6 +39,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
if: ${{ inputs.with-artifact }}
|
||||||
with:
|
with:
|
||||||
name: client
|
name: client
|
||||||
path: client/dist
|
path: client/dist
|
||||||
|
|||||||
@@ -11,23 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
client_test:
|
client_test:
|
||||||
name: Test Client Build
|
name: Test Client Build
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/client_build.yml
|
||||||
|
with:
|
||||||
steps:
|
# Do not upload artifacts for test builds
|
||||||
- uses: actions/checkout@v4
|
with-arifact: false
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: client/package-lock.json
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: ./client
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build client
|
|
||||||
working-directory: ./client
|
|
||||||
run: npm run build
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
# do not run on forks
|
# do not run on forks
|
||||||
#
|
#
|
||||||
if: github.repository_owner == 'm1k1o'
|
if: github.repository_owner == 'm1k1o'
|
||||||
needs: [ build-base ]
|
needs: build-base
|
||||||
strategy:
|
strategy:
|
||||||
# Will build all images even if some fail.
|
# Will build all images even if some fail.
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|||||||
@@ -11,12 +11,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
build-apps:
|
build-apps:
|
||||||
uses: ./.github/workflows/image_app.yml
|
uses: ./.github/workflows/image_app.yml
|
||||||
needs: [ build-base ]
|
needs: build-base
|
||||||
strategy:
|
strategy:
|
||||||
# Will build all images even if some fail.
|
# Will build all images even if some fail.
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -40,5 +39,4 @@ jobs:
|
|||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
dockerfile: ${{ matrix.dockerfile }}
|
dockerfile: ${{ matrix.dockerfile }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|||||||
@@ -12,12 +12,11 @@ jobs:
|
|||||||
flavor: arm
|
flavor: arm
|
||||||
platforms: linux/arm64,linux/arm/v7
|
platforms: linux/arm64,linux/arm/v7
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
build-apps:
|
build-apps:
|
||||||
uses: ./.github/workflows/image_app.yml
|
uses: ./.github/workflows/image_app.yml
|
||||||
needs: [ build-base ]
|
needs: build-base
|
||||||
strategy:
|
strategy:
|
||||||
# Will build all images even if some fail.
|
# Will build all images even if some fail.
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -32,5 +31,4 @@ jobs:
|
|||||||
dockerfile: ${{ matrix.dockerfile }}
|
dockerfile: ${{ matrix.dockerfile }}
|
||||||
flavor: arm
|
flavor: arm
|
||||||
platforms: linux/arm64,linux/arm/v7
|
platforms: linux/arm64,linux/arm/v7
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|||||||
@@ -12,12 +12,11 @@ jobs:
|
|||||||
flavor: intel
|
flavor: intel
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
dockerfile: Dockerfile.intel
|
dockerfile: Dockerfile.intel
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
build-apps:
|
build-apps:
|
||||||
uses: ./.github/workflows/image_app.yml
|
uses: ./.github/workflows/image_app.yml
|
||||||
needs: [ build-base ]
|
needs: build-base
|
||||||
strategy:
|
strategy:
|
||||||
# Will build all images even if some fail.
|
# Will build all images even if some fail.
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -42,5 +41,4 @@ jobs:
|
|||||||
dockerfile: ${{ matrix.dockerfile }}
|
dockerfile: ${{ matrix.dockerfile }}
|
||||||
flavor: intel
|
flavor: intel
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|||||||
@@ -12,12 +12,11 @@ jobs:
|
|||||||
flavor: nvidia
|
flavor: nvidia
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
dockerfile: Dockerfile.nvidia
|
dockerfile: Dockerfile.nvidia
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
build-apps:
|
build-apps:
|
||||||
uses: ./.github/workflows/image_app.yml
|
uses: ./.github/workflows/image_app.yml
|
||||||
needs: [ build-base ]
|
needs: build-base
|
||||||
strategy:
|
strategy:
|
||||||
# Will build all images even if some fail.
|
# Will build all images even if some fail.
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -38,5 +37,4 @@ jobs:
|
|||||||
dockerfile: ${{ matrix.dockerfile }}
|
dockerfile: ${{ matrix.dockerfile }}
|
||||||
flavor: nvidia
|
flavor: nvidia
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
secrets:
|
secrets: inherit
|
||||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
build-base:
|
build-base:
|
||||||
name: Build and Publish Base Image
|
name: Build and Publish Base Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build-client ]
|
needs: build-client
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
name: Build and Publish Server Artifacts
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
#pull_request: # Change to push when ready to deploy
|
|
||||||
# branches:
|
|
||||||
# - master
|
|
||||||
# paths:
|
|
||||||
# - server/**
|
|
||||||
# - .github/workflows/server_build.yml
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
server_build:
|
|
||||||
name: Build and Publish Server Artifacts
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
variant:
|
|
||||||
- name: server-amd64
|
|
||||||
platform: linux/amd64
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
- name: server-arm64
|
|
||||||
platform: linux/arm64
|
|
||||||
dockerfile: Dockerfile.bookworm
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
# Temporary hotfix for the setup-qemu-action
|
|
||||||
# Ref: https://github.com/tonistiigi/binfmt/issues/240
|
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
image: tonistiigi/binfmt:qemu-v7.0.0-28
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Build Docker image
|
|
||||||
id: build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./server/
|
|
||||||
file: ./server/${{ matrix.variant.dockerfile }}
|
|
||||||
tags: ${{ matrix.variant.name }}
|
|
||||||
platforms: ${{ matrix.variant.platform }}
|
|
||||||
load: true
|
|
||||||
|
|
||||||
- name: Copy artifacts
|
|
||||||
run: |
|
|
||||||
container_id=$(docker create ${{ matrix.variant.name }})
|
|
||||||
mkdir -p artifacts/${{ matrix.variant.name }}
|
|
||||||
docker cp $container_id:/src/bin/. artifacts/${{ matrix.variant.name }}/
|
|
||||||
docker rm $container_id
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.variant.name }}
|
|
||||||
path: artifacts/${{ matrix.variant.name }}
|
|
||||||
@@ -9,7 +9,7 @@ on:
|
|||||||
- .github/workflows/server_test.yml
|
- .github/workflows/server_test.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
server_test:
|
server-test-amd64:
|
||||||
name: Test Server Build
|
name: Test Server Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -24,3 +24,21 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./server
|
context: ./server
|
||||||
|
platforms: linux/amd64
|
||||||
|
|
||||||
|
server-test-arm64:
|
||||||
|
name: Test Server Build
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./server
|
||||||
|
platforms: linux/arm64
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: Build and Publish Webpage Artifacts
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
with-artifact:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
description: |
|
||||||
|
If true, the build artifacts will be uploaded as a GitHub Actions artifact.
|
||||||
|
This is useful for debugging and testing purposes. If false, the artifacts
|
||||||
|
will not be uploaded. This is useful for test builds where you don't need
|
||||||
|
the artifacts.
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
webpage-build:
|
||||||
|
name: Build and Publish Webpage Artifacts
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: webpage/package-lock.json
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
working-directory: ./webpage
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build webpage
|
||||||
|
working-directory: ./webpage
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- if: ${{ inputs.with-artifact }}
|
||||||
|
name: Upload artifacts
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
artifact-name: github-pages
|
||||||
|
path: ./webpage/build
|
||||||
@@ -9,37 +9,14 @@ on:
|
|||||||
- .github/workflows/webpage_deploy.yml
|
- .github/workflows/webpage_deploy.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
webpage_build:
|
webpage-build:
|
||||||
name: Build and Deploy Webpage to GitHub Pages
|
name: Build Webpage Artifacts
|
||||||
runs-on: ubuntu-latest
|
uses: .github/workflows/webpage_build.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
steps:
|
webpage-deploy:
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: webpage/package-lock.json
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: ./webpage
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build webpage
|
|
||||||
working-directory: ./webpage
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Upload Build Artifact
|
|
||||||
uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
artifact-name: github-pages
|
|
||||||
path: ./webpage/build
|
|
||||||
|
|
||||||
webpage_deploy:
|
|
||||||
name: Deploy to GitHub Pages
|
name: Deploy to GitHub Pages
|
||||||
needs: webpage_build
|
needs: webpage-build
|
||||||
|
|
||||||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -9,23 +9,10 @@ on:
|
|||||||
- .github/workflows/webpage_test.yml
|
- .github/workflows/webpage_test.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
webpage_test:
|
webpage-test:
|
||||||
name: Test Webpage Build
|
name: Test Webpage Build
|
||||||
runs-on: ubuntu-latest
|
uses: .github/workflows/webpage_build.yml
|
||||||
|
with:
|
||||||
steps:
|
with-artifact: false
|
||||||
- uses: actions/checkout@v4
|
secrets: inherit
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: webpage/package-lock.json
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: ./webpage
|
|
||||||
run: npm ci
|
|
||||||
- name: Build webpage
|
|
||||||
working-directory: ./webpage
|
|
||||||
run: npm run build
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ RUN set -eux; apt-get update; \
|
|||||||
#
|
#
|
||||||
# install firefox-esr for armhf
|
# install firefox-esr for armhf
|
||||||
apt-get install -y --no-install-recommends firefox-esr; \
|
apt-get install -y --no-install-recommends firefox-esr; \
|
||||||
ln -s /usr/bin/firefox-esr /usr/bin/firefox; \
|
ln -s /usr/lib/firefox-esr /usr/lib/firefox; \
|
||||||
#
|
#
|
||||||
# install extensions
|
# install extensions
|
||||||
mkdir -p /usr/lib/firefox-esr/distribution/extensions; \
|
mkdir -p /usr/lib/firefox-esr/distribution/extensions; \
|
||||||
|
|||||||
Reference in New Issue
Block a user