mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
feat!: rewrite proxy app with fastify (#3269)
* feat: initial fastify source * chore: remove extra stuff from git ignore * feat: rename to rest passthrough * feat: add swcrc file * feat: add Dockerfile * feat: more rest passthrough stuff * fix: add node_modules to Dockerfile * feat: misc passthrough changes * feat: add host to dockerfile * feat: add version tags and update names * feat: remove the old proxy application * feat: update registry package name * feat: re-add schedule * feat: cliff jumper initi * feat: update changelog * style: git cliff formatting * feat: update cliffjumper rc * feat: updating version for future cliff-jump run * revert: package name back * feat: add release script * feat: update dependabot configuration to manage rest passthrough app * chore: update actions/download-artifact version * feat: adding removal of the version in URL. * feat: making readme better
This commit is contained in:
@@ -15,3 +15,7 @@ updates:
|
||||
schedule:
|
||||
# Check for updates to GitHub Actions every week
|
||||
interval: 'daily'
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/docker-apps/rest-passthrough'
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
|
||||
+59
-23
@@ -1,23 +1,52 @@
|
||||
name: Rest proxy
|
||||
name: Docker App - Rest Passthrough
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths:
|
||||
- '.github/workflows/rest-proxy.yml'
|
||||
- 'proxies/rest/**'
|
||||
- '.github/workflows/docker-app-rest-passthrough.yml'
|
||||
- 'docker-apps/rest-passthrough/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/rest-proxy.yml'
|
||||
- 'proxies/rest/**'
|
||||
- '.github/workflows/docker-app-rest-passthrough.yml'
|
||||
- 'docker-apps/rest-passthrough/**'
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
run-release:
|
||||
name: Run release script
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Git config
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
- name: Run release script
|
||||
run: |
|
||||
yarn release
|
||||
git push && git push --tags
|
||||
|
||||
app-version:
|
||||
name: Get app version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.package-version.outputs.current-version }}
|
||||
steps:
|
||||
- name: get-npm-version
|
||||
id: package-version
|
||||
uses: martinbeentjes/npm-get-version-action@v1.3.1
|
||||
with:
|
||||
path: docker-apps/rest-passthrough
|
||||
|
||||
build:
|
||||
name: Build docker image
|
||||
runs-on: ubuntu-latest
|
||||
needs: app-version
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache Docker layers
|
||||
@@ -35,10 +64,12 @@ jobs:
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: false
|
||||
tags: discordeno/rest-proxy:latest
|
||||
context: proxies/rest
|
||||
tags:
|
||||
- 'discordeno/app-rest-passthrough:latest'
|
||||
- 'discordeno/app-rest-passthrough:v${{ needs.app-version.outputs.version }}'
|
||||
context: docker-apps/rest-passthrough
|
||||
target: runner
|
||||
outputs: type=docker,dest=/tmp/rest-proxy-image.tar
|
||||
outputs: type=docker,dest=/tmp/rest-passthrough-image.tar
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
- # Temp fix
|
||||
@@ -51,8 +82,8 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rest-proxy-image
|
||||
path: /tmp/rest-proxy-image.tar
|
||||
name: rest-passthrough-image
|
||||
path: /tmp/rest-passthrough-image.tar
|
||||
|
||||
image-scan:
|
||||
name: Image scan
|
||||
@@ -63,16 +94,16 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: rest-proxy-image
|
||||
name: rest-passthrough-image
|
||||
path: /tmp
|
||||
- name: Load Docker image
|
||||
run: docker load --input /tmp/rest-proxy-image.tar
|
||||
run: docker load --input /tmp/rest-passthrough-image.tar
|
||||
- name: Run Trivy vulnerability scanner
|
||||
uses: aquasecurity/trivy-action@master
|
||||
with:
|
||||
image-ref: 'discordeno/rest-proxy:latest'
|
||||
image-ref: 'discordeno/app-rest-passthrough:latest'
|
||||
format: 'table'
|
||||
exit-code: '0'
|
||||
ignore-unfixed: true
|
||||
@@ -82,7 +113,7 @@ jobs:
|
||||
uses: aquasecurity/trivy-action@master
|
||||
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' }}
|
||||
with:
|
||||
image-ref: 'discordeno/rest-proxy:latest'
|
||||
image-ref: 'discordeno/app-rest-passthrough:latest'
|
||||
exit-code: '0'
|
||||
vuln-type: 'os,library'
|
||||
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL'
|
||||
@@ -101,8 +132,8 @@ jobs:
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
with:
|
||||
image: 'discordeno/rest-proxy:latest'
|
||||
args: --file=proxies/rest/Dockerfile
|
||||
image: 'discordeno/app-rest-passthrough:latest'
|
||||
args: --file=docker-apps/rest-passthrough/Dockerfile
|
||||
- name: Upload result to GitHub Code Scanning
|
||||
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' }}
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
@@ -111,7 +142,7 @@ jobs:
|
||||
|
||||
build-all-arch:
|
||||
name: Build image for all architectures
|
||||
needs: build
|
||||
needs: [build, app-version]
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -131,9 +162,12 @@ jobs:
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: proxies/rest
|
||||
context: docker-apps/rest-passthrough
|
||||
push: false
|
||||
tags: 'discordeno/rest-proxy:latest'
|
||||
tags:
|
||||
- 'discordeno/app-rest-passthrough:latest'
|
||||
- 'discordeno/app-rest-passthrough:v${{ needs.app-version.outputs.version }}'
|
||||
|
||||
# linux/s390x stuck at yarn install, remove it for now
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le
|
||||
target: runner
|
||||
@@ -149,7 +183,7 @@ jobs:
|
||||
|
||||
publish:
|
||||
name: Publish image
|
||||
needs: build-all-arch
|
||||
needs: [run-release, build-all-arch, app-version]
|
||||
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@@ -171,9 +205,11 @@ jobs:
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: proxies/rest
|
||||
context: docker-apps/rest-passthrough
|
||||
push: true
|
||||
tags: 'ghcr.io/discordeno/rest-proxy:latest'
|
||||
tags:
|
||||
- 'ghcr.io/discordeno/app-rest-passthrough:latest'
|
||||
- 'ghcr.io/discordeno/app-rest-passthrough:v${{ needs.app-version.outputs.version }}'
|
||||
# linux/s390x stuck at yarn install, remove it for now
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le
|
||||
target: runner
|
||||
Reference in New Issue
Block a user