Modify worflows and update actions

pull/232/head
Uruk 1 year ago
parent 91a3a1a592
commit 98d517f8ce

@ -0,0 +1,86 @@
name: ASS CI
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
test:
name: Test Build
runs-on: ubuntu-latest
container: node:20-alpine
steps:
- name: Checkout
uses: actions/checkout@v4
# Install npm 10 & TypeScript
- name: Install global packages
run: npm i -g npm@10 typescript
# Install ass dependencies (including types)
- name: Install dependencies
run: npm i --save-dev
# Compile the TypeScript files
- name: Run build script
run: npm run 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-latest
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: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
build-args: |
COMMIT_TAG=${{ github.sha }}
tags: |
tycrek/ass: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-latest
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

@ -39,11 +39,11 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v2
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v1 uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@ -68,4 +68,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v2

@ -3,6 +3,7 @@ on:
push: push:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -10,17 +11,17 @@ jobs:
ARCHIVE_NAME: ass-build-${{ github.run_id }}-${{ github.run_number }} ARCHIVE_NAME: ass-build-${{ github.run_id }}-${{ github.run_number }}
steps: steps:
# Checkout repo # Checkout repo
- uses: actions/checkout@v2 - uses: actions/checkout@v4
# Set up Node 16 # Set up Node 20
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v2.4.1 uses: actions/setup-node@v3
with: with:
node-version: 16.14.0 node-version: 20
# Install npm 8 & TypeScript # Install npm 10 & TypeScript
- name: Install global packages - name: Install global packages
run: npm i -g npm@8 typescript run: npm i -g npm@10 typescript
# Install ass dependencies (including types) # Install ass dependencies (including types)
- name: Install dependencies - name: Install dependencies
@ -38,7 +39,7 @@ jobs:
# Upload archive as an artifact # Upload archive as an artifact
- name: Upload archive - name: Upload archive
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v3
with: with:
name: ${{ env.ARCHIVE_NAME }} name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_NAME }}.zip path: ${{ env.ARCHIVE_NAME }}.zip

Loading…
Cancel
Save