Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
baloola committed Jul 24, 2024
2 parents 1b11711 + 108947e commit 60fcf6a
Show file tree
Hide file tree
Showing 142 changed files with 23,620 additions and 1,167 deletions.
7 changes: 6 additions & 1 deletion .crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ files:
ignore:
- config.json
- custom.json
translation: /src/locales/%two_letters_code%/%original_file_name%
translation: /src/locales/%locale%/%original_file_name%
pull_request_title: "Update translations"
pull_request_labels: [
"i18n / l10n",
"CI run required"
]
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"STAC_BROWSER_VERSION": "readonly",
"CONFIG_PATH": "readonly",
"CONFIG_CLI": "readonly",
"require": "readonly"
"require": "readonly",
"process": "readonly"
},
"extends": [
"plugin:vue/strongly-recommended",
Expand Down Expand Up @@ -41,4 +42,4 @@
"vue/this-in-template": "error",
"vue/match-component-file-name": "error"
}
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# *nix shell scripts always use LF (see .editorconfig)
*.sh eol=lf
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
* @m-mohr
Dockerfile @waystilos @geospatial-jeff
docker/ @waystilos @geospatial-jeff @constantinius
Dockerfile @waystilos @geospatial-jeff @constantinius
src/locales/de-CH @p1d1d1
src/locales/es @rnanclares
src/locales/fr @jfbourgon
src/locales/fr-CA @jfbourgon
src/locales/fr-CH @p1d1d1
src/locales/it @p1d1d1
src/locales/it-CH @p1d1d1
src/locales/ro @mneagul
src/locales/ro @mneagul
src/locales/pt @psacra
src/locales/pt-BR @uba
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm install
- run: npm run build -- --pathPrefix="/stac-browser" --historyMode=hash
- uses: peaceiris/actions-gh-pages@v3
Expand All @@ -19,4 +19,4 @@ jobs:
publish_dir: dist
exclude_assets: 'report.html'
user_name: 'STAC Browser CI'
user_email: [email protected]
user_email: [email protected]
29 changes: 29 additions & 0 deletions .github/workflows/fix-i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Fix CrowdIn commits
on:
pull_request:
types:
- unlabeled
jobs:
deploy:
if: ${{ github.event.label.name == 'CI run required' }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
- run: npm install
- run: node helpers/fix-crowdin.js
- name: Commit changes
run: |
git config user.name "STAC Browser CI"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m ":robot: Automated update for locales: ${timestamp} [skip ci]" || exit 0
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish

on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: "Tag name"
required: true

env:
REGISTRY: ghcr.io
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}

jobs:
retag-docker-image:
runs-on: ubuntu-latest
name: Push updated Docker image

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set environment variables
run: |
echo VERSION=${TAG_NAME#v} >> $GITHUB_ENV
echo IMAGE_NAME=$REGISTRY/$(echo ${GITHUB_REPOSITORY,,}) >> $GITHUB_ENV
echo COMMITED_AT=$(git show -s --format=%cI `git rev-parse HEAD`) >> $GITHUB_ENV
echo REVISION=$(git rev-parse --short HEAD) >> $GITHUB_ENV
- name: Collect Docker image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.created=${{ env.COMMITED_AT }}
org.opencontainers.image.version=v${{ env.VERSION }}
org.opencontainers.image.maintainer=$({github.repository_owner})
tags: |
type=semver,pattern={{version}},value=v${{ env.VERSION }}
- name: Log in to the GitHub container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ env.VERSION }}
REVISION=${{ env.REVISION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:edge
cache-to: type=inline
57 changes: 28 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
.DS_Store
.cache/
node_modules
/dist


# local env files
.env
.env.local
.env.*.local

# lock files
/yarn.lock
/package-lock.json

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.DS_Store
.cache/
node_modules
/dist


# local env files
.env
.env.local
.env.*.local

# lock files
/yarn.lock

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
ARG pathPrefix="/"

FROM node:lts-alpine3.18 AS build-step
ARG DYNAMIC_CONFIG=true
ARG catalogURL
ARG historyMode="history"
ARG pathPrefix

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN \[ "${DYNAMIC_CONFIG}" == "true" \] && sed -i 's/<!-- <script defer="defer" src=".\/config.js"><\/script> -->/<script defer="defer" src=".\/config.js"><\/script>/g' public/index.html
RUN npm run build -- --catalogUrl=$catalogURL
RUN \[ "${DYNAMIC_CONFIG}" == "true" \] && sed -i "s|<!-- <script defer=\"defer\" src=\"/config.js\"></script> -->|<script defer=\"defer\" src=\"${pathPrefix}config.js\"></script>|g" public/index.html
RUN npm run build -- --historyMode="${historyMode}" --pathPrefix="${pathPrefix}"


FROM nginx:1-alpine-slim
ARG pathPrefix

COPY --from=build-step /app/dist /usr/share/nginx/html
COPY ./config.schema.json /etc/nginx/conf.d/config.schema.json
RUN apk add jq pcre-tools

# change default port to 8080
RUN apk add jq pcre-tools && \
sed -i 's/\s*listen\s*80;/ listen 8080;/' /etc/nginx/conf.d/default.conf && \
sed -i 's/\s*location \/ {/ location \/ {\n try_files $uri $uri\/ \/index.html;/' /etc/nginx/conf.d/default.conf
COPY ./config.schema.json /etc/nginx/conf.d/config.schema.json
COPY --from=build-step /app/dist /usr/share/nginx/html
COPY --from=build-step /app/docker/default.conf /etc/nginx/conf.d/default.conf
RUN sed -i "s|<pathPrefix>|${pathPrefix}|" /etc/nginx/conf.d/default.conf

EXPOSE 8080

Expand Down
Loading

0 comments on commit 60fcf6a

Please sign in to comment.