From 27a1deadec39722f8b2507e809afa5731b4c0708 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 09:46:19 +0300 Subject: [PATCH 01/13] fix --- .dockerignore | 33 +++++++++++++++++++++++++++++++++ Dockerfile | 29 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f766fcc --- /dev/null +++ b/.dockerignore @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f7b1b2 --- /dev/null +++ b/Dockerfile @@ -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;"] \ No newline at end of file From 649a48debcee6cb186006a30d1d88a51bdc34d7d Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 09:58:45 +0300 Subject: [PATCH 02/13] fix --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1bd0ed3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Build and publish + +on: + push: + branches: [ master ] + +env: + PLATFORMS: linux/amd64,linux/arm64 + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: image=moby/buildkit:master + + - name: Build and Push Docker image + id: push-docker + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + platforms: ${{ env.PLATFORMS }} + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + provenance: false + outputs: type=docker,dest=crontab-docker.tar + \ No newline at end of file From 7a8cad55123f3b96abb4724bc489c7b01975a5e5 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:00:36 +0300 Subject: [PATCH 03/13] fix --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1bd0ed3..8291cc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,4 @@ jobs: push: true tags: | ghcr.io/${{ github.repository }}:latest - provenance: false - outputs: type=docker,dest=crontab-docker.tar - \ No newline at end of file + provenance: false \ No newline at end of file From f177cbea38a4e289ec1771e34e172c7ee9971ceb Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:05:36 +0300 Subject: [PATCH 04/13] fix --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8291cc6..e906c48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,11 @@ name: Build and publish on: - push: - branches: [ master ] + push: + branches: [ master ] env: - PLATFORMS: linux/amd64,linux/arm64 + PLATFORMS: ${{ vars.PLATFORMS }} jobs: build-and-publish: From 934e7175ded0e42725e1fad2324f1a27dec2e4b6 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:05:57 +0300 Subject: [PATCH 05/13] fix --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e906c48..4bb55ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,10 @@ on: env: PLATFORMS: ${{ vars.PLATFORMS }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: build-and-publish: runs-on: ubuntu-latest From 30892fa25f8dc36269ffd9c0568367185f9b8e28 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:10:35 +0300 Subject: [PATCH 06/13] fix --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4bb55ab..7a1ad65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + token: ${{ secrets.MY_PAT_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -26,6 +28,13 @@ jobs: with: driver-opts: image=moby/buildkit:master + - 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 id: push-docker uses: docker/build-push-action@v6 From 35231e8524ca4942a8ec9e8f7e9b2847cc4187f7 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:11:43 +0300 Subject: [PATCH 07/13] fix --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a1ad65..a734473 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,11 +9,11 @@ env: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false + cancel-in-progress: true jobs: build-and-publish: - runs-on: ubuntu-latest + runs-on: self-hosted-amd64 steps: - name: Checkout code uses: actions/checkout@v4 From eaf98f5afb399cc4bcf2373b493f3c4a4e89f009 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:29:31 +0300 Subject: [PATCH 08/13] fix --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a734473..2391fe6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ name: Build and publish on: push: branches: [ master ] + workflow_dispatch: env: PLATFORMS: ${{ vars.PLATFORMS }} @@ -13,7 +14,7 @@ concurrency: jobs: build-and-publish: - runs-on: self-hosted-amd64 + runs-on: ${{ vars.RUNNER_OS }} steps: - name: Checkout code uses: actions/checkout@v4 From 55bf0db3a17b53955084e9860d73121d8b936dfa Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 10:43:51 +0300 Subject: [PATCH 09/13] fix --- .github/workflows/build.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2391fe6..45b3858 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,45 +5,49 @@ on: branches: [ master ] workflow_dispatch: -env: - PLATFORMS: ${{ vars.PLATFORMS }} - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build-and-publish: - runs-on: ${{ vars.RUNNER_OS }} + strategy: + matrix: + include: + - platform: linux/amd64 + runner: self-hosted-amd64 + - platform: linux/arm64 + runner: self-hosted-arm64 + runs-on: ${{ matrix.runner }} 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 with: driver-opts: image=moby/buildkit:master - + - 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 - id: push-docker uses: docker/build-push-action@v6 with: context: . file: Dockerfile - platforms: ${{ env.PLATFORMS }} + platforms: ${{ matrix.platform }} push: true - tags: | - ghcr.io/${{ github.repository }}:latest - provenance: false \ No newline at end of file + tags: ghcr.io/${{ github.repository }}:latest + provenance: false + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file From dc598329afe81f57c34b1305bc0297fafac571c3 Mon Sep 17 00:00:00 2001 From: bariiss Date: Thu, 12 Sep 2024 11:00:20 +0300 Subject: [PATCH 10/13] fix --- public/index.html | 26 ++------------------------ public/manifest.json | 2 +- src/ui/components/Navbar/index.tsx | 10 +--------- src/ui/screens/Home/index.tsx | 5 +---- 4 files changed, 5 insertions(+), 38 deletions(-) diff --git a/public/index.html b/public/index.html index 6b4252c..fa4d15b 100755 --- a/public/index.html +++ b/public/index.html @@ -8,35 +8,13 @@ content="width=device-width, initial-scale=1, shrink-to-fit=no" /> - + - - - Cron expression generator by Cronhub + Crontab
- - - diff --git a/public/manifest.json b/public/manifest.json index 5496aa2..c4428f3 100755 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,5 +1,5 @@ { - "short_name": "crontab.am", + "short_name": "cron.il1.nl", "name": "Cron expression generator", "icons": [ { diff --git a/src/ui/components/Navbar/index.tsx b/src/ui/components/Navbar/index.tsx index 1cc91ce..46c5d24 100644 --- a/src/ui/components/Navbar/index.tsx +++ b/src/ui/components/Navbar/index.tsx @@ -34,15 +34,7 @@ const Nav = styled.nav` const Navbar = () => ( diff --git a/src/ui/screens/Home/index.tsx b/src/ui/screens/Home/index.tsx index d5e8a54..53ed553 100644 --- a/src/ui/screens/Home/index.tsx +++ b/src/ui/screens/Home/index.tsx @@ -80,10 +80,7 @@ export default class Home extends Component< return ( - Cron expression generator by{" "} - - Cronhub - . Schedule and monitor jobs without any infra work. + Schedule and monitor jobs without any infra work. Date: Mon, 16 Sep 2024 10:10:06 +0300 Subject: [PATCH 11/13] Update build.yml --- .github/workflows/build.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45b3858..6bc3c4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,14 +11,7 @@ concurrency: jobs: build-and-publish: - strategy: - matrix: - include: - - platform: linux/amd64 - runner: self-hosted-amd64 - - platform: linux/arm64 - runner: self-hosted-arm64 - runs-on: ${{ matrix.runner }} + runs-on: it steps: - name: Checkout code uses: actions/checkout@v4 @@ -45,9 +38,8 @@ jobs: with: context: . file: Dockerfile - platforms: ${{ matrix.platform }} + platforms: linux/amd64,linux/arm64 push: true + no-cache: true tags: ghcr.io/${{ github.repository }}:latest provenance: false - cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file From d3cdf8a23e36cc03000a532bb2480f4782fb5871 Mon Sep 17 00:00:00 2001 From: Baris Dogu <49743443+bariiss@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:15:43 +0300 Subject: [PATCH 12/13] Update build.yml --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bc3c4d..464ec4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,8 +23,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - with: - driver-opts: image=moby/buildkit:master - name: Login to GitHub Container Registry uses: docker/login-action@v3 From 870a2b999b16d8a7ee1824d58bfcda02ffe9dda0 Mon Sep 17 00:00:00 2001 From: Baris Dogu <49743443+bariiss@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:07:45 +0300 Subject: [PATCH 13/13] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 464ec4c..4331af5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ concurrency: jobs: build-and-publish: - runs-on: it + runs-on: ocean steps: - name: Checkout code uses: actions/checkout@v4