Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
.gitignore
eslint.config.js
README.md
23 changes: 23 additions & 0 deletions .github/workflows/build-and-push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and Push

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Docker Image
run: make build
- name: Login to GitHub Container Registry
run: echo ${{ secrets.REPOSITORY_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Get Repository name
run: echo USER_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Push Docker Image
run: |
docker tag flags ghcr.io/${{ env.USER_REPOSITORY }}:latest
docker push ghcr.io/${{ env.USER_REPOSITORY }}:latest
16 changes: 16 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build Test

on:
pull_request:
branches:
- main
- develop

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Docker Image
run: make build
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20.19.5-alpine AS base

COPY . ./code
WORKDIR /code

# Build application
RUN yarn install
RUN yarn build


FROM nginx:stable-alpine

COPY --from=base ./code/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build-docker:
docker build -t flags:latest .
build:
make build-docker
prune:
docker container prune -f
start-app:
docker run -p 4000:80 --name flags flags:latest
run:
make prune && make start-app
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/flag.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>flags</title>
<title>Lorna's Flag Keyboard</title>
</head>
<body>
<div id="root"></div>
Expand Down
Loading