Skip to content

Commit

Permalink
Merge pull request #1 from sakowicz/github-workflow
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
sakowicz authored Jun 9, 2024
2 parents 79aa811 + 25c54e7 commit 120e528
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Docker Image CI
on: push
jobs:
docker:
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: Build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
11 changes: 11 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Docker Image CI
on: push
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm ci
- name: Run ESLint
run: ./node_modules/.bin/eslint **/*.js
30 changes: 30 additions & 0 deletions .github/workflows/release-build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Push Docker Images
on:
release:
types: [published]
jobs:
docker:
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: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
push: true
tags: sakowicz/actual-ai:${{ github.ref }}
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM node:20.14-alpine
FROM node:18.20-alpine3.20

ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV

RUN npm i npm@10.7 -g

USER node

WORKDIR /opt/node_app
Expand Down
Empty file added Readme.md
Empty file.
6 changes: 1 addition & 5 deletions src/transaction-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function findUUIDInString(str) {
async function syncAccounts() {
console.log('Syncing bank accounts');
try {
await suppressConsoleLogsAsync(async () => await actualApi.runBankSync());
await suppressConsoleLogsAsync(async () => actualApi.runBankSync());
console.log('Bank accounts synced');
} catch (error) {
console.error('Error syncing bank accounts:', error);
Expand Down Expand Up @@ -88,10 +88,6 @@ async function processTransactions() {
category: guessCategory.id,
notes: `${transaction.notes} ${NOTES_GUESSED}`,
});

if (i >= 0) {
break;
}
}
}
module.exports = {
Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
async function suppressConsoleLogsAsync(callback) {
const originalConsoleLog = console.log;
// eslint-disable-next-line func-names
console.log = function () {};
const result = await callback();
console.log = originalConsoleLog;
Expand Down

0 comments on commit 120e528

Please sign in to comment.