Skip to content
Closed

Test #327

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/check-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check Dependency
on:
workflow_call:

jobs:
check-dependencies:
runs-on: ubuntu-latest
steps:
- name: Action Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 22.11.0
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install Dependencies
run: npm install

- name: Audit and Fix vulnerabilies
run: npm audit fix --force
continue-on-error: true
25 changes: 25 additions & 0 deletions .github/workflows/check-test-cases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run test cases
on:
workflow_call:

jobs:
run-test-cases:
runs-on: ubuntu-latest
steps:
- name: Action Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 22.11.0
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install Dependencies
run: npm install

- name: Check Test Cases
run: npm run test
10 changes: 10 additions & 0 deletions .github/workflows/pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Pull Requests

on:
pull_request:
branches:
- 'master'

jobs:
check-dependencies:
uses: iorikaze/startbootstrap-resume/.github/workflows/check-dependency.yaml@master
63 changes: 63 additions & 0 deletions .github/workflows/push-ecr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Push to ECR
on:
workflow_dispatch:
inputs:
image-tag:
description: 'Tag of the Docker Image'
required: true

permissions:
id-token: write
contents: read

jobs:
check-dependencies:
uses: iorikaze/startbootstrap-resume/.github/workflows/check-dependencies.yaml@master

check-test-cases:
needs: check-dependencies
uses: iorikaze/startbootstrap-resume/.github/workflows/check-test-cases.yaml@master

create-docker-image:
needs: check-test-cases
runs-on: ubuntu-latest

steps:
- name: Action Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: 22.11.0
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install Dependencies
run: npm install

- name: Build Dependencies
run: npm run build

- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.IAM_ROLE }}
aws-region: ap-southeast-1

- name: Login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
provenance: true

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: iorikaze-ecr-repo
IMAGE_TAG: ${{ inputs.image-tag }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18-alpine

WORKDIR /home/node

COPY ./scripts ./app/scripts
COPY ./src ./app/src
COPY ./node_modules ./app/node_modules
COPY ./dist ./app/dist
COPY package*.json ./app

USER node

EXPOSE 3000 3000
EXPOSE 3001 3001

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl --fail http://localhost:3000 || exit 1

WORKDIR /app

CMD ["node", "scripts/start.js"]
2 changes: 1 addition & 1 deletion dist/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@charset "UTF-8";
/*!
* Start Bootstrap - Resume v7.0.6 (https://startbootstrap.com/theme/resume)
* Copyright 2013-2023 Start Bootstrap
* Copyright 2013-2025 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-resume/blob/master/LICENSE)
*/
/*!
Expand Down
2 changes: 1 addition & 1 deletion dist/js/scripts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Start Bootstrap - Resume v7.0.6 (https://startbootstrap.com/theme/resume)
* Copyright 2013-2023 Start Bootstrap
* Copyright 2013-2025 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-resume/blob/master/LICENSE)
*/
//
Expand Down
Loading