Skip to content

Commit

Permalink
add:initWorflow
Browse files Browse the repository at this point in the history
  • Loading branch information
moshdev2213 committed Sep 7, 2024
1 parent 005208a commit 7627e38
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Node modules should not be copied to the Docker image as they are re-installed during the build process.
node_modules
npm-debug.log
yarn-debug.log
yarn-error.log

# Exclude the local environment variables
.env
.env.local
.env.*.local

# Output directories
dist
build

# Exclude Dockerfile and Docker ignore file itself
Dockerfile
.dockerignore

# Ignore any git-related files
.git
.gitignore

# Exclude local development files and tools
.vscode
.idea
*.swp

# OS generated files
.DS_Store
Thumbs.db

# Logs and temporary files
*.log
*.tmp

# netlfiy configs
netlfiy.toml

44 changes: 44 additions & 0 deletions .github/workflows/docker_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Seller App Docker Build and Push

on:
push:
branches:
- master

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 Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/apekade_seller:latest
-
name: Add build summary
run: |
echo '### 🚀 Docker Build and Push Summary' > $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '🔧 **Build Status**: The Docker image has been successfully built and pushed.' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '🛠️ **Build Context**: .' >> $GITHUB_STEP_SUMMARY
echo '📦 **Image Tag**: ${{ secrets.DOCKERHUB_USERNAME }}/apekade_seller:latest' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '🎉 **Thanks for using GitHub Actions!**' >> $GITHUB_STEP_SUMMARY
41 changes: 41 additions & 0 deletions .github/workflows/post.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Review

on:
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
review:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Add Summary for reviews
run: echo '### reviews Workflow Summary 🚀' > $GITHUB_STEP_SUMMARY

- name: Post review message for issues
if: github.event_name == 'issues'
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
--request POST \
--data '{"body":"👋 Thank you for opening this issue! We will get back to you shortly."}' \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
echo 'Issue review message posted.' >> $GITHUB_STEP_SUMMARY
- name: Post review message for pull requests
if: github.event_name == 'pull_request_target'
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
--request POST \
--data '{"body":"🎉 Thank you for this pull request! We will review it as soon as possible."}' \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments
echo 'Pull request review message posted.' >> $GITHUB_STEP_SUMMARY
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use an official Node.js runtime as a parent image
FROM node:20-alpine

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the app
RUN npm run build

# Expose port 4757
EXPOSE 4757

# Start nginx
CMD ["npm","run","preview"]
4 changes: 4 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
preview: {
host: true,
port: 4757
}
})

0 comments on commit 7627e38

Please sign in to comment.