Skip to content

Commit

Permalink
Updating workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaland committed Jan 23, 2025
1 parent a852998 commit f453817
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- release*
- docker-build
tags:
- v*

Expand Down Expand Up @@ -57,14 +58,18 @@ jobs:
- name: Install dependencies
run: |
npm install
- name: Build Distribution
run: |
npm build
# TODO: Figure out a cleaner way to do this
- name: 'Tar files'
run: tar -cvf code.tar .
run: tar -cvf dist.tar dist
- name: Archive node modules
uses: actions/upload-artifact@v4
with:
name: code
path: code.tar
name: dist
path: dist.tar
include-hidden-files: true
retention-days: 1
build-image:
Expand All @@ -88,11 +93,12 @@ jobs:
- name: Download node modules
uses: actions/download-artifact@v4
with:
name: code
name: dist
path: .

- name: 'Untar files'
run: tar -xvf code.tar
run: tar -xvf dist.tar


- name: Build and push
uses: docker/build-push-action@v2
Expand Down
23 changes: 8 additions & 15 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal AS production
# Use an official Nginx runtime as a parent image
FROM registry.redhat.io/rhel9/nginx-120@sha256:612b6b8f0e58a80b31b820d04798ba1ebb1f06f121ed06b11f7ddc00ecd91502

WORKDIR app_home
# Copy the dist folder to the Nginx html directory
COPY dist /usr/share/nginx/html

COPY . .

# Create .cache directories
USER root
# Expose port 80 to the outside world
EXPOSE 80

RUN npm install

# Expose the port the app will run on
USER 1001

EXPOSE 3000

# Start the application
CMD /bin/sh -c "npm run build && npm start"
# Command to run Nginx
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit f453817

Please sign in to comment.