Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

... #29

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

... #29

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
33 changes: 33 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Ignore node_modules since it will be installed inside the container
node_modules
build
dist

# Ignore logs and temp files
*.log
*.tmp
*.cache

# Ignore local environment configuration
.env
.env.local

# Ignore yarn error log
yarn-error.log

# Ignore git directory and related files
.git
.gitignore

# Ignore IDE/editor specific files
.vscode
.idea
*.swp

# Ignore Docker-specific files
Dockerfile
docker-compose.yml

# Ignore any other unnecessary files or directories
README.md
LICENSE
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and publish

on:
push:
branches: [ master ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-publish:
runs-on: ocean
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.MY_PAT_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.MY_PAT_TOKEN }}

- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
tags: ghcr.io/${{ github.repository }}:latest
provenance: false
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use an official Node.js runtime as the base image
FROM node:16-alpine AS build

# Set the working directory inside the container
WORKDIR /app

# Copy the package.json and yarn.lock files to install dependencies
COPY package.json yarn.lock ./

# Install dependencies
RUN yarn install

# Copy the rest of the application code to the container
COPY . .

# Build the React application
RUN yarn build

# Stage 2: Serve the built files using a lightweight server (nginx)
FROM nginx:alpine

# Copy the build output from the previous stage to the nginx public directory
COPY --from=build /app/build /usr/share/nginx/html

# Expose the default Nginx port
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
26 changes: 2 additions & 24 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,13 @@
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<meta name="description" content="Cron expression generator by Cronhub">
<meta name="description" content="Cron expression generator">
<meta name="keywords" content="cronhub, cron expression, cron schedule, cron expression syntax, cron syntax, cron expression every 10 minutes">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Cron expression generator by Cronhub</title>
<title>Crontab</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-133136809-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

gtag('config', 'UA-133136809-1');
</script>
</html>
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"short_name": "crontab.am",
"short_name": "cron.il1.nl",
"name": "Cron expression generator",
"icons": [
{
Expand Down
10 changes: 1 addition & 9 deletions src/ui/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ const Nav = styled.nav`
const Navbar = () => (
<Nav>
<ul>
<li>
<ContributeButton
target="_blank"
rel="noopener noreferrer"
href="https://github.com/cronhub/crontab"
>
Contribute
</ContributeButton>
</li>
<li></li>
<li></li>
</ul>
</Nav>
Expand Down
5 changes: 1 addition & 4 deletions src/ui/screens/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ export default class Home extends Component<
return (
<InnerContainer>
<ValuePropContainer>
Cron expression generator by{" "}
<a href="https://cronhub.io?utm_source=crontab&utm_medium=referral&utm_campaign=sideproject-campaign" title="crontab">
Cronhub
</a>. Schedule and monitor jobs without any infra work.
Schedule and monitor jobs without any infra work.
</ValuePropContainer>
<Wrapper>
<Field
Expand Down