-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added/updated cicd supporting artifacts
- Loading branch information
Showing
5 changed files
with
185 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Release CI | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
build-test: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Deno v1.36.1 | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.36.1 | ||
|
||
- name: Verify formatting | ||
run: deno task fmt | ||
|
||
- name: Run linter | ||
run: deno lint | ||
|
||
- name: Run tests and coverage | ||
run: deno task test | ||
|
||
docker: | ||
name: Publish Docker Image | ||
needs: [ build-test ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: trackerforce/switcher-searchdocs | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM denoland/deno:alpine-1.37.0 | ||
|
||
ENV APP_HOME=/home/app | ||
WORKDIR $APP_HOME | ||
|
||
COPY /src/deps.ts $APP_HOME | ||
|
||
RUN deno cache deps.ts | ||
|
||
COPY /src . | ||
|
||
RUN addgroup -S app && \ | ||
adduser -S app -G app && \ | ||
chown -R app:app $APP_HOME /deno-dir | ||
|
||
USER app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: '3.8' | ||
|
||
# TLS Enabled | ||
# volumes: | ||
# switcherapi-tls: | ||
# driver: local | ||
# driver_opts: | ||
# o: bind | ||
# type: none | ||
# device: "/data/certs" | ||
|
||
services: | ||
app: | ||
image: trackerforce/switcher-searchdocs:latest | ||
container_name: switcher-searchdocs | ||
command: ["run", "--allow-net", "--allow-env", "--allow-read", "index.ts"] | ||
ports: | ||
- 4000:4000 | ||
environment: | ||
- APP_PORT=4000 | ||
- RELEASE_TIME=today | ||
# - SSL_CERT=/etc/ssl/certs/tls.crt | ||
# - SSL_KEY=/etc/ssl/certs/tls.pem | ||
|
||
- APP_RATE_LIMIT=10 | ||
- APP_RATE_LIMIT_WINDOW=3000 | ||
- LOG_LEVEL=INFO # DEBUG, INFO, ERROR | ||
|
||
# Skimming Global Settings | ||
- APP_URL=https://raw.githubusercontent.com/petruki/skimming/master/ | ||
- APP_FILES=README.md | ||
- APP_CACHE_EXP_DURATION=5 | ||
- APP_CACHE_SIZE=100 | ||
- APP_ALLOW_URL=false | ||
- APP_ALLOW_FILES=false | ||
# volumes: | ||
# - switcherapi-tls:/etc/ssl/certs |