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:
|
||||
workflow_call:
|
||||
#pull_request: # Change to push when ready to deploy
|
||||
# branches:
|
||||
# - master
|
||||
# paths:
|
||||
# - client/**
|
||||
# - .github/workflows/client_build.yml
|
||||
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:
|
||||
client_build:
|
||||
@@ -35,6 +39,7 @@ jobs:
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ inputs.with-artifact }}
|
||||
with:
|
||||
name: client
|
||||
path: client/dist
|
||||
|
||||
@@ -11,23 +11,7 @@ on:
|
||||
jobs:
|
||||
client_test:
|
||||
name: Test Client Build
|
||||
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: client/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./client
|
||||
run: npm ci
|
||||
|
||||
- name: Build client
|
||||
working-directory: ./client
|
||||
run: npm run build
|
||||
uses: ./.github/workflows/client_build.yml
|
||||
with:
|
||||
# Do not upload artifacts for test builds
|
||||
with-arifact: false
|
||||
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
# do not run on forks
|
||||
#
|
||||
if: github.repository_owner == 'm1k1o'
|
||||
needs: [ build-base ]
|
||||
needs: build-base
|
||||
strategy:
|
||||
# Will build all images even if some fail.
|
||||
fail-fast: false
|
||||
|
||||
@@ -11,12 +11,11 @@ jobs:
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
dockerfile: Dockerfile
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: [ build-base ]
|
||||
needs: build-base
|
||||
strategy:
|
||||
# Will build all images even if some fail.
|
||||
fail-fast: false
|
||||
@@ -40,5 +39,4 @@ jobs:
|
||||
name: ${{ matrix.name }}
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
@@ -12,12 +12,11 @@ jobs:
|
||||
flavor: arm
|
||||
platforms: linux/arm64,linux/arm/v7
|
||||
dockerfile: Dockerfile
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: [ build-base ]
|
||||
needs: build-base
|
||||
strategy:
|
||||
# Will build all images even if some fail.
|
||||
fail-fast: false
|
||||
@@ -32,5 +31,4 @@ jobs:
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
flavor: arm
|
||||
platforms: linux/arm64,linux/arm/v7
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
@@ -12,12 +12,11 @@ jobs:
|
||||
flavor: intel
|
||||
platforms: linux/amd64
|
||||
dockerfile: Dockerfile.intel
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: [ build-base ]
|
||||
needs: build-base
|
||||
strategy:
|
||||
# Will build all images even if some fail.
|
||||
fail-fast: false
|
||||
@@ -42,5 +41,4 @@ jobs:
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
flavor: intel
|
||||
platforms: linux/amd64
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
@@ -12,12 +12,11 @@ jobs:
|
||||
flavor: nvidia
|
||||
platforms: linux/amd64
|
||||
dockerfile: Dockerfile.nvidia
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: [ build-base ]
|
||||
needs: build-base
|
||||
strategy:
|
||||
# Will build all images even if some fail.
|
||||
fail-fast: false
|
||||
@@ -38,5 +37,4 @@ jobs:
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
flavor: nvidia
|
||||
platforms: linux/amd64
|
||||
secrets:
|
||||
GHCR_ACCESS_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }}
|
||||
secrets: inherit
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
build-base:
|
||||
name: Build and Publish Base Image
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build-client ]
|
||||
needs: build-client
|
||||
steps:
|
||||
- name: Checkout
|
||||
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
|
||||
|
||||
jobs:
|
||||
server_test:
|
||||
server-test-amd64:
|
||||
name: Test Server Build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@@ -24,3 +24,21 @@ jobs:
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
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
|
||||
|
||||
jobs:
|
||||
webpage_build:
|
||||
name: Build and Deploy Webpage to GitHub Pages
|
||||
runs-on: ubuntu-latest
|
||||
webpage-build:
|
||||
name: Build Webpage Artifacts
|
||||
uses: .github/workflows/webpage_build.yml
|
||||
secrets: inherit
|
||||
|
||||
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
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
artifact-name: github-pages
|
||||
path: ./webpage/build
|
||||
|
||||
webpage_deploy:
|
||||
webpage-deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
needs: webpage_build
|
||||
needs: webpage-build
|
||||
|
||||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
||||
permissions:
|
||||
|
||||
@@ -9,23 +9,10 @@ on:
|
||||
- .github/workflows/webpage_test.yml
|
||||
|
||||
jobs:
|
||||
webpage_test:
|
||||
webpage-test:
|
||||
name: Test Webpage Build
|
||||
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
|
||||
uses: .github/workflows/webpage_build.yml
|
||||
with:
|
||||
with-artifact: false
|
||||
secrets: inherit
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ RUN set -eux; apt-get update; \
|
||||
#
|
||||
# install firefox-esr for armhf
|
||||
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
|
||||
mkdir -p /usr/lib/firefox-esr/distribution/extensions; \
|
||||
|
||||
Reference in New Issue
Block a user