Skip to content

Commit

Permalink
chore(gh-actions): backend
Browse files Browse the repository at this point in the history
  • Loading branch information
krystxf committed Apr 21, 2024
1 parent a84bac5 commit 6a6b8e9
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 28 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Backend
on:
push:
# paths:
# - "backend/**"
paths-ignore:
- "**/*.md"
- "**/*.mdx"
- "**/**.example.*"

jobs:
ci:
name: CI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- run: |
cd ./backend
bun install
bun run build
publish-docker-image:
needs: 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

- name: Create commit comment
uses: peter-evans/commit-comment@v3
id: cc
with:
body: |
🐳Backend successfully built and published to [Docker Hub](https://hub.docker.com/r/krystxf/metro-now-backend/tags)!🎉
- name: Check outputs
run: |
echo "Comment ID - ${{ steps.cc.outputs.comment-id }}"
28 changes: 0 additions & 28 deletions .github/workflows/ci.yaml

This file was deleted.

0 comments on commit 6a6b8e9

Please sign in to comment.