Skip to content

Commit

Permalink
ARM64 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Doges committed Sep 28, 2023
1 parent 564d365 commit a3490dd
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 35 deletions.
59 changes: 34 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [ push, pull_request_target ]
on: [push, pull_request_target]

env:
DOCKER_REGISTRY: switchbladebot/invidget
NODE_VERSION: 18.x

jobs:
lint:
Expand All @@ -9,40 +13,45 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
annotate: true
- name: Standard
run: npx standard
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
env:
CI: true
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
env:
CI: true

build:
name: Docker
runs-on: ubuntu-latest
needs: [lint, test]
if: github.event_name == 'push'
strategy:
matrix:
node-version: [latest, ${{ github.ref }}]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and publish to registry
uses: docker/build-push-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: switchbladebot/invidget
tag_with_ref: true
- name: Checkout
uses: actions/checkout@v3
- name: Build and publish to registry
uses: docker/build-push-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ env.DOCKER_REGISTRY }}
tag_with_ref: ${{ matrix.tag }}
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM node:lts-alpine

# Build Stage
FROM node:lts-alpine as build
WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install
COPY . .

# Production Stage
FROM node:lts-alpine
WORKDIR /usr/src/app
COPY --from=build /usr/src/app /usr/src/app
EXPOSE 80

CMD [ "node", "src/index.js" ]
CMD [ "node", "src/index.js" ]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Switchblade
Copyright (c) 2023 Switchblade

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"name": "invidget",
"version": "1.0.0",
"version": "1.1.0",
"description": "SVG invite widgets that look just like the ones on the Discord client!",
"main": "src/index.js",
"engines": {
"node": ">=12"
},
"dependencies": {
"@sentry/node": "^6.13.2",
"@svgdotjs/svg.js": "^3.1.1",
"dd-trace": "^1.4.1",
"express": "^4.17.1",
"morgan": "^1.10.0",
"node-fetch": "^2.6.0",
"sharp": "^0.29.1",
"node-fetch": "^2.6.12",
"sharp": "^0.32.4",
"svgdom": "^0.1.8",
"text-to-svg": "^3.1.5",
"winston": "^3.10.0"
Expand All @@ -33,6 +36,11 @@
"type": "git",
"url": "git+https://github.com/SwitchbladeBot/invidget.git"
},
"cpu": [
"x64",
"ia32",
"arm"
],
"standard": {
"env": [
"jest"
Expand Down

0 comments on commit a3490dd

Please sign in to comment.