Skip to content

Commit

Permalink
Add frontend compilation step to deploy.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jed-g committed Jan 8, 2024
1 parent c2ffff9 commit 662b868
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,6 @@ jobs:
with:
fetch-depth: 0

- name: Set Up Node.js For Frontend Compilation
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Yarn
run: npm install -g yarn

- name: Compile Frontend
run: |
cd frontend
yarn check --integrity || yarn install
yarn deploy
- name: Amend compilation changes to last commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit --amend --no-edit
- name: Dokku
uses: dokku/[email protected]
with:
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# syntax = docker/dockerfile:1

# Compile frontend in Node.js environment
FROM node:20-alpine as frontend

WORKDIR /frontend

COPY frontend ./
RUN yarn install
RUN yarn deploy

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.1.2
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
Expand Down

0 comments on commit 662b868

Please sign in to comment.