Skip to content

Commit

Permalink
Merge pull request #1 from swimlane/master
Browse files Browse the repository at this point in the history
Merge CI/CD changes
  • Loading branch information
anbabane authored Jan 24, 2025
2 parents c2456bd + 5c40d2f commit 60f91ae
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build and Deploy
permissions:
contents: write # Allow write permission to GITHUB_TOKEN to commit to deploy branch.
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Bundle and ship angular to gh-pages
uses: AhsanAyaz/[email protected]
with:
base_href: /
deploy_branch: gh-pages
angular_dist_build_folder: dist/turbine-status/browser
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/bazel-out

# Node
/node_modules
node_modules/
npm-debug.log
yarn-error.log

Expand Down
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Dockerfile for Angular Application

# Stage 1: Build the application
FROM node:22 AS build

# Set working directory
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install -g @angular/cli
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the Angular application
RUN npm run build

# Stage 2: Serve the application
FROM node:22 AS serve

# Set working directory
WORKDIR /usr/src/app

# Install production dependencies only
COPY package.json package-lock.json ./

RUN npm install -g @angular/cli
RUN npm install --production

# Copy built files from the build stage
COPY --from=build /usr/src/app/dist /usr/src/app/dist

# Expose application port
EXPOSE 4000

# Start the application
CMD ["npm", "run", "serve:ssr:turbine-status"]
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}

0 comments on commit 60f91ae

Please sign in to comment.