This commit is contained in:
Luke Gustafson
2024-11-27 01:07:44 +00:00
parent b16bc1a5bb
commit 5dedadddf9
9 changed files with 146 additions and 33 deletions

View File

@@ -11,21 +11,30 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build frontend
- name: Install 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
- 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
@@ -33,8 +42,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker build -f docker/Dockerfile . --tag ghcr.io/$REPO_NAME/ssh-project:$DATE_TAG
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/$REPO_NAME/ssh-project:$DATE_TAG
run: docker push ghcr.io/${{ github.repository_owner }}/ssh-project:${{ github.run_id }}