Skip to content

Commit

Permalink
Merge pull request #8 from krystxf/refactor/github-actions
Browse files Browse the repository at this point in the history
chore(gh-actions): backend, frontend
  • Loading branch information
krystxf authored Apr 21, 2024
2 parents a84bac5 + 398bda7 commit 85d942e
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 29 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 0 additions & 28 deletions .github/workflows/ci.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
3 changes: 2 additions & 1 deletion backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ docker-compose*
.git
.gitignore

*.md
*.md
*.mdx

0 comments on commit 85d942e

Please sign in to comment.