From 4ae9622ced6cb895ef1ea7cfe9079263ac4bb50e Mon Sep 17 00:00:00 2001 From: Krystof Date: Sun, 21 Apr 2024 23:57:02 +0200 Subject: [PATCH 1/3] chore(gh-actions): backend --- .github/workflows/backend.yaml | 48 ++++++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 28 -------------------- backend/.dockerignore | 3 ++- 3 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/backend.yaml delete mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/backend.yaml b/.github/workflows/backend.yaml new file mode 100644 index 00000000..f0d369be --- /dev/null +++ b/.github/workflows/backend.yaml @@ -0,0 +1,48 @@ +name: Backend + +on: push + +jobs: + backend-ci: + name: CI + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + + - run: | + cd ./backend + bun install + bun run build + + publish-docker-image: + needs: backend-ci + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + 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 Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and publish + uses: docker/build-push-action@v5 + with: + context: ./backend + push: true + tags: krystxf/metro-now-backend:latest diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index d7441beb..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: CI -on: push - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 - - - run: | - cd ./backend - bun install - bun run build - - build-docker: - name: Build Docker Image - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 - - - run: | - cd ./backend - bun install - bun run docker:build diff --git a/backend/.dockerignore b/backend/.dockerignore index b2ff2248..9153d690 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -8,4 +8,5 @@ docker-compose* .git .gitignore -*.md \ No newline at end of file +*.md +*.mdx \ No newline at end of file From 31bb4247144a3086f637e7527caadd0555e8fc3d Mon Sep 17 00:00:00 2001 From: Krystof Date: Mon, 22 Apr 2024 00:40:49 +0200 Subject: [PATCH 2/3] chore(gh-actions): frontend --- .github/workflows/frontend.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/frontend.yaml diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml new file mode 100644 index 00000000..1299ba0b --- /dev/null +++ b/.github/workflows/frontend.yaml @@ -0,0 +1,24 @@ +name: Frontend + +on: push + +jobs: + frontend-ci: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - run: | + cd ./frontend + pnpm install + pnpm run lint From 398bda706973c79d114d61aed82d0adc8ada6e86 Mon Sep 17 00:00:00 2001 From: Krystof Date: Mon, 22 Apr 2024 00:50:16 +0200 Subject: [PATCH 3/3] chore(readme): add actions status --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 207377d2..0fceffb9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # METRO NOW + +[![Backend](https://github.com/krystxf/metro-now/actions/workflows/backend.yaml/badge.svg)](https://github.com/krystxf/metro-now/actions/workflows/backend.yaml) +[![Frontend](https://github.com/krystxf/metro-now/actions/workflows/frontend.yaml/badge.svg)](https://github.com/krystxf/metro-now/actions/workflows/frontend.yaml) + Soon on App store\ ![Download_on_the_App Store](https://github.com/krystxf/metro-now/assets/48121710/4cafe145-eab2-4c79-9ef2-0fced1111b09)