Commit
This commit is contained in:
48
.local/share/code-server/User/History/-75aa7516/YqrT.yml
Normal file
48
.local/share/code-server/User/History/-75aa7516/YqrT.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
- name: Install and Build Frontend
|
||||
run: |
|
||||
cd frontend
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Login to Docker Registry (GHCR)
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -f Dockerfile -t ghcr.io/${{ github.repository_owner }}/ssh-project:${{ github.run_id }} .
|
||||
|
||||
- name: Push Docker image to GHCR
|
||||
run: docker push ghcr.io/${{ github.repository_owner }}/ssh-project:${{ github.run_id }}
|
||||
@@ -1 +1 @@
|
||||
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/.github/workflows/docker-image.yml","entries":[{"id":"9X2e.yml","timestamp":1732667889336},{"id":"3EZP.yml","timestamp":1732667936044}]}
|
||||
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/.github/workflows/docker-image.yml","entries":[{"id":"9X2e.yml","timestamp":1732667889336},{"id":"3EZP.yml","timestamp":1732667936044},{"id":"jUoS.yml","source":"undoRedo.source","timestamp":1732667990352},{"id":"YqrT.yml","timestamp":1732669649485}]}
|
||||
41
.local/share/code-server/User/History/-75aa7516/jUoS.yml
Normal file
41
.local/share/code-server/User/History/-75aa7516/jUoS.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Build and Push Docker Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Set up Docker login to GHCR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate docker tag
|
||||
id: prep
|
||||
run: |
|
||||
echo "REPO_NAME=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||
echo "DATE_TAG=$(date +%s)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -f docker/Dockerfile . --tag ghcr.io/$REPO_NAME/ssh-project:$DATE_TAG
|
||||
|
||||
- name: Push Docker image to GHCR
|
||||
run: docker push ghcr.io/$REPO_NAME/ssh-project:$DATE_TAG
|
||||
23
.local/share/code-server/User/History/2e659bb2/EvMq
Normal file
23
.local/share/code-server/User/History/2e659bb2/EvMq
Normal file
@@ -0,0 +1,23 @@
|
||||
# Build frontend
|
||||
FROM node:18-slim AS frontend-build
|
||||
WORKDIR /app
|
||||
COPY frontend/package*.json ./frontend/
|
||||
RUN npm --prefix frontend install
|
||||
COPY frontend/ ./frontend/
|
||||
RUN npm --prefix frontend run build
|
||||
|
||||
# Build backend
|
||||
FROM node:18-slim AS backend-build
|
||||
WORKDIR /backend
|
||||
COPY backend/package*.json ./
|
||||
RUN npm install
|
||||
COPY backend/ .
|
||||
|
||||
# Production image
|
||||
FROM nginx:alpine
|
||||
# Copy frontend static files to nginx folder
|
||||
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html
|
||||
# Copy backend application
|
||||
COPY --from=backend-build /backend /backend
|
||||
# Start backend and frontend servers
|
||||
CMD ["sh", "-c", "node /backend/server.js & nginx -g 'daemon off;'"]
|
||||
@@ -1 +1 @@
|
||||
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/docker/Dockerfile","entries":[{"id":"TUF1","timestamp":1732635492973},{"id":"8otg","timestamp":1732635506681},{"id":"XU8z","source":"undoRedo.source","timestamp":1732635515769},{"id":"ars1","timestamp":1732635532917},{"id":"8UPb","timestamp":1732635628577},{"id":"gWeB","timestamp":1732635658901},{"id":"Z5sv","source":"undoRedo.source","timestamp":1732635671649},{"id":"J4VB","timestamp":1732635674581},{"id":"eNc9","timestamp":1732651223530},{"id":"qz6w","timestamp":1732666102382},{"id":"dg9u","timestamp":1732666385636},{"id":"xeWT","timestamp":1732666594049},{"id":"VKz9","timestamp":1732666699486},{"id":"ohj0","timestamp":1732666756338},{"id":"YYfg","timestamp":1732666912166},{"id":"fk8j","source":"undoRedo.source","timestamp":1732666929490},{"id":"KzCQ","timestamp":1732666932302},{"id":"Ksxv","timestamp":1732666980583},{"id":"YyhO","timestamp":1732667021083},{"id":"fABD","timestamp":1732667045735},{"id":"9QEU","timestamp":1732667168771},{"id":"ZvDX","source":"undoRedo.source","timestamp":1732667172295},{"id":"b8fu","timestamp":1732667181363},{"id":"U8fB","timestamp":1732667377239},{"id":"qfRq","timestamp":1732667388987},{"id":"EPuH","timestamp":1732667567379},{"id":"ErcD","timestamp":1732667709908}]}
|
||||
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/docker/Dockerfile","entries":[{"id":"TUF1","timestamp":1732635492973},{"id":"8otg","timestamp":1732635506681},{"id":"XU8z","source":"undoRedo.source","timestamp":1732635515769},{"id":"ars1","timestamp":1732635532917},{"id":"8UPb","timestamp":1732635628577},{"id":"gWeB","timestamp":1732635658901},{"id":"Z5sv","source":"undoRedo.source","timestamp":1732635671649},{"id":"J4VB","timestamp":1732635674581},{"id":"eNc9","timestamp":1732651223530},{"id":"qz6w","timestamp":1732666102382},{"id":"dg9u","timestamp":1732666385636},{"id":"xeWT","timestamp":1732666594049},{"id":"VKz9","timestamp":1732666699486},{"id":"ohj0","timestamp":1732666756338},{"id":"YYfg","timestamp":1732666912166},{"id":"fk8j","source":"undoRedo.source","timestamp":1732666929490},{"id":"KzCQ","timestamp":1732666932302},{"id":"Ksxv","timestamp":1732666980583},{"id":"YyhO","timestamp":1732667021083},{"id":"fABD","timestamp":1732667045735},{"id":"9QEU","timestamp":1732667168771},{"id":"ZvDX","source":"undoRedo.source","timestamp":1732667172295},{"id":"b8fu","timestamp":1732667181363},{"id":"U8fB","timestamp":1732667377239},{"id":"qfRq","timestamp":1732667388987},{"id":"EPuH","timestamp":1732667567379},{"id":"ErcD","timestamp":1732667709908},{"id":"EvMq","timestamp":1732669655605}]}
|
||||
Reference in New Issue
Block a user