Skip to content

Commit

Permalink
add docker build actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hkbu-kennycheng committed Oct 31, 2024
1 parent 61617c7 commit 55e7e71
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,20 @@ jobs:
with:
name: dist
path: dist/
- 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:
registry: ${{ secrets.KENNYSDOCKER_REGISTRY }}
username: ${{ secrets.KENNYSDOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.KENNYSDOCKER_REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ secrets.KENNYSDOCKER_REGISTRY }}/comp3047-fall2024/vue:${{ github.event.repository.name }}
env:
EXPRESS_REPO: ${{ secrets.COMP3047_FALL2024_EXPRESS_REPO }}${{ github.actor }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG EXPRESS_REPO
FROM ${EXPRESS_REPO}

COPY dist/* /app/public/
RUN sed -i 's/next(createError(404));/res.status(404).sendFile(path.join(__dirname, "public", "index.html"));/' /app/app.js

0 comments on commit 55e7e71

Please sign in to comment.