-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb31807
commit cd5fb35
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Streamyfin Optimized Version Server CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
name: Lint & Test Build | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-22.04 | ||
container: node:22-alpine | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Lint | ||
run: npm lint | ||
- name: Formatting | ||
run: npm format:check | ||
- name: Build | ||
run: npm build | ||
|
||
build_and_push: | ||
name: Build & Publish Docker Images | ||
if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]') | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: Set lower case owner name | ||
run: | | ||
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} | ||
env: | ||
OWNER: ${{ github.repository_owner }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
fredrikburmester/streamyfin-optimized-versions-server:master | ||
discord: | ||
name: Send Discord Notification | ||
needs: build_and_push | ||
if: always() && github.event_name != 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]') | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Get Build Job Status | ||
uses: technote-space/workflow-conclusion-action@v3 | ||
- name: Combine Job Status | ||
id: status | ||
run: | | ||
failures=(neutral, skipped, timed_out, action_required) | ||
if [[ ${array[@]} =~ $WORKFLOW_CONCLUSION ]]; then | ||
echo "status=failure" >> $GITHUB_OUTPUT | ||
else | ||
echo "status=$WORKFLOW_CONCLUSION" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Post Status to Discord | ||
uses: sarisia/actions-status-discord@v1 | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
status: ${{ steps.status.outputs.status }} | ||
title: ${{ github.workflow }} | ||
nofail: true |