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

feat: some enhancement #26

Merged
merged 8 commits into from
Jan 10, 2025
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
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version: 2
updates:
- package-ecosystem: github-actions
directory: /
open-pull-requests-limit: 20
commit-message:
prefix: deps
include: scope
Expand All @@ -22,7 +21,6 @@ updates:
- package-ecosystem: npm
directory: /
versioning-strategy: increase
open-pull-requests-limit: 20
commit-message:
prefix: deps
include: scope
Expand Down
83 changes: 0 additions & 83 deletions .github/labels.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ env:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/checkout@v4

- name: 🏗 Setup Docker Buildx
uses: docker/setup-buildx-action@v3.8.0
uses: docker/setup-buildx-action@v3

- name: 🏗 Log into registry ${{ env.REGISTRY }}
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -49,16 +49,16 @@ jobs:

- name: 🏗 Extract metadata
id: meta
uses: docker/metadata-action@v5.6.1
uses: docker/metadata-action@v5
if: ${{ github.event_name != 'pull_request' }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
images: name=${{ env.REGISTRY }}/${{ env.USERNAME }}/decap-cms-github-backend,enable=true

labels: |
org.opencontainers.image.authors=njfamirm@gmail.com
org.opencontainers.image.title=@alwatr/decap-cms-github-backend
org.opencontainers.image.description='Self-hosted decap cms github backend'
org.opencontainers.image.title=@njfamirm/decap-cms-github-backend
org.opencontainers.image.description='Self-hosted decap cms github backend.'

tags: |
type=semver,enable=true,pattern={{major}}
Expand All @@ -69,7 +69,7 @@ jobs:

- name: 🚀 Build and push container image
id: build-and-push
uses: docker/build-push-action@v6.11.0
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -80,13 +80,3 @@ jobs:
# build-args: |
cache-from: type=gha
cache-to: type=gha,mode=max

# - name: 🏗 Install cosign
# if: ${{ github.event_name != 'pull_request' }}
# uses: sigstore/cosign-installer@v3.0.5

# - name: 🏗 Sign the published container image
# if: ${{github.event_name != 'pull_request'}}
# env:
# COSIGN_EXPERIMENTAL: 'true'
# run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign --yes {}@${{steps.build-and-push.outputs.digest}}
30 changes: 0 additions & 30 deletions .github/workflows/sync-labels.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG NODE_IMAGE=docker.io/library/node:20-alpine
ARG NODE_IMAGE=docker.io/library/node:22-alpine

FROM $NODE_IMAGE as builder

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

WORKDIR /app

ENV NODE_ENV production

Check warning on line 7 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# Install dependencies
COPY package.json *.lock ./
Expand All @@ -27,17 +27,17 @@

# ---

FROM $NODE_IMAGE as app

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

WORKDIR /app

CMD ["yarn", "serve"]

ENV NODE_ENV production

Check warning on line 36 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV NODE_OPTIONS --enable-source-maps

Check warning on line 37 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
# ENV ALWATR_DEBUG 1
ENV HOST 0.0.0.0

Check warning on line 39 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV PORT 80

Check warning on line 40 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Container

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
EXPOSE 80

# Copy all deps from last stage
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Decap CMS Github backend

OAuth service as Github backend for Decap CMS.
OAuth service as Github backend for Decap CMS inspired by [netlify-cms-oauth](https://github.com/ublabs/netlify-cms-oauth)

## Usage

Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "decap-cms-github-backend",
"author": "Adrián UB",
"contributors": [
"S. Amir Mohammad Najafi <njfamirm@gamil.com> (https://www.njfamirm.ir)"
],
"name": "@njfamirm/decap-cms-github-backend",
"author": "S. Amir Mohammad Najafi <njfamirm@gamil.com> (https://www.njfamirm.ir)",
"description": "Self-hosted decap cms github backend.",
"version": "1.1.0",
"license": "MIT",
"private": true,
Expand All @@ -17,7 +15,7 @@
"start": "NODE_OPTIONS=--enable-source-maps run-s clean build serve",
"build": "yarn build:es --analyze=verbose",
"build:ts": "tsc --build",
"build:es": "esbuild src/index.ts --platform=node --external:simple-oauth2 --target=node19 --bundle --format=esm --minify --sourcemap --outdir=dist --out-extension:.js=.mjs",
"build:es": "esbuild src/index.ts --platform=node --external:simple-oauth2 --target=node22 --bundle --format=esm --minify --sourcemap --outdir=dist --out-extension:.js=.mjs",
"clean": "rm -rf dist build .tsbuildinfo",
"serve": "node --enable-source-maps dist/index.mjs",
"serve:debug": "node --inspect --enable-source-maps dist/index.mjs",
Expand Down
Loading