This commit is contained in:
Luke Gustafson
2024-11-27 00:39:02 +00:00
parent b06fcb47bd
commit b16bc1a5bb
3 changed files with 48 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest

View File

@@ -0,0 +1,40 @@
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: Install dependencies and build frontend
run: |
cd frontend
npm install
npm run build
ls -R . # Debugging: List files in frontend after build
- name: Debug workspace structure
run: ls -R /github/workspace # Debugging: Verify where `dist` is created
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Docker login to 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 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

View File

@@ -1 +1 @@
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/.github/workflows/docker-image.yml","entries":[{"id":"9X2e.yml","timestamp":1732667889336}]}
{"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}]}