Skip to content

Commit acccb09

Browse files
authored
Merge pull request #1 from fullstack-devops/bugfix/init
init Image
2 parents 1b99aa0 + fab5e21 commit acccb09

File tree

8 files changed

+240
-1
lines changed

8 files changed

+240
-1
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [eksrha] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "docker" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"

.github/workflows/anchore.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow checks out code, builds an image, performs a container image
7+
# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security
8+
# code scanning feature. For more information on the Anchore scan action usage
9+
# and parameters, see https://github.com/anchore/scan-action. For more
10+
# information on Anchore's container image scanning tool Grype, see
11+
# https://github.com/anchore/grype
12+
name: Anchore Container Scan
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
branches: [ main ]
19+
schedule:
20+
- cron: '45 5 * * 1'
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
Anchore-Build-Scan:
27+
permissions:
28+
contents: read # for actions/checkout to fetch code
29+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout the code
33+
uses: actions/checkout@v3
34+
35+
- name: Scan current project
36+
id: scan
37+
uses: anchore/scan-action@v3
38+
with:
39+
path: "."
40+
acs-report-enable: true
41+
42+
- name: Upload Anchore Scan Report
43+
uses: github/codeql-action/upload-sarif@v2
44+
with:
45+
sarif_file: ${{ steps.scan.outputs.sarif }}

.github/workflows/build-pr.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build PR
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
IMAGE_BASE: "ghcr.io/${{ github.repository_owner }}/excalidraw"
8+
9+
jobs:
10+
generate_infos:
11+
uses: fullstack-devops/actions/.github/workflows/generate-build-infos.yml@main
12+
secrets:
13+
token: ${{ secrets.GITHUB_TOKEN }}
14+
15+
build:
16+
runs-on: ubuntu-latest
17+
needs: generate_infos
18+
steps:
19+
- name: Check out the repo
20+
uses: actions/checkout@v2
21+
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v1
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.repository_owner }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v1
31+
- name: Set up Docker Buildx
32+
id: buildx
33+
uses: docker/setup-buildx-action@v1
34+
35+
- name: Build excalidraw:pr-${{ github.event.pull_request.number }}
36+
uses: docker/build-push-action@v2
37+
with:
38+
context: ./
39+
push: true
40+
tags: |
41+
${{ env.IMAGE_BASE }}:pr-${{ github.event.pull_request.number }}

.github/workflows/cleanup-pr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Cleanup PR
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
purge-image:
9+
name: Delete image from ghcr.io
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Delete excalidraw:pr-${{ github.event.pull_request.number }}
13+
uses: bots-house/ghcr-delete-image-action@v1.0.0
14+
with:
15+
owner: ${{ github.repository_owner }}
16+
name: excalidraw
17+
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
18+
tag: pr-${{ github.event.pull_request.number }}

.github/workflows/create-release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Create Release
2+
3+
concurrency:
4+
group: ci-${{ github.repository }}-release
5+
cancel-in-progress: false
6+
7+
on:
8+
push:
9+
branches:
10+
- "main"
11+
12+
env:
13+
IMAGE_NAME: "${{ github.repository_owner }}/excalidraw"
14+
15+
jobs:
16+
create_release:
17+
uses: fullstack-devops/actions/.github/workflows/create-release.yml@main
18+
secrets:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
build:
22+
runs-on: ubuntu-latest
23+
needs: create_release
24+
steps:
25+
- name: Check out the repo
26+
uses: actions/checkout@v2
27+
28+
- name: Login to GitHub Container Registry
29+
uses: docker/login-action@v1
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.repository_owner }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Login to Red Hat Quay
35+
uses: docker/login-action@v1
36+
with:
37+
registry: quay.io
38+
username: ${{ secrets.RH_QUAY_USERNAME }}
39+
password: ${{ secrets.RH_QUAY_PASSWORD }}
40+
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v1
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v1
45+
46+
- name: Build excalidraw
47+
uses: docker/build-push-action@v2
48+
with:
49+
context: ./
50+
push: true
51+
tags: |
52+
ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}
53+
ghcr.io/${{ env.IMAGE_NAME }}:latest
54+
quay.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}
55+
quay.io/${{ env.IMAGE_NAME }}:latest
56+
57+
publish_release:
58+
runs-on: ubuntu-latest
59+
needs: [create_release, build_base, build_flavors]
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v2
63+
- name: Setup awesome-ci
64+
uses: fullstack-devops/awesome-ci-action@main
65+
66+
- name: Publish Release
67+
run: awesome-ci release publish -releaseid "$ACI_RELEASE_ID"
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
ACI_RELEASE_ID: ${{ needs.create_release.outputs.releaseid }}
71+
72+
# - name: update helm charts appVersion
73+
# uses: peter-evans/repository-dispatch@v2
74+
# with:
75+
# token: ${{ secrets.HELM_REPO_TOKEN }}
76+
# repository: fullstack-devops/helm-charts
77+
# event-type: update_chart_version
78+
# client-payload: '{"chart": "excalidraw", "version": "${{ needs.create_release.outputs.version }}"}'

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:14 AS build
2+
3+
WORKDIR /opt/node_app
4+
5+
ARG EXCALIDRAW_VERSION="0.12.0"
6+
7+
RUN git clone --depth 1 --branch v${EXCALIDRAW_VERSION} https://github.com/excalidraw/excalidraw ./
8+
9+
RUN yarn --ignore-optional
10+
11+
ARG NODE_ENV=production
12+
RUN yarn build:app:docker
13+
14+
FROM nginxinc/nginx-unprivileged:1.23.0-alpine
15+
16+
COPY --from=build /opt/node_app/build /usr/share/nginx/html
17+
18+
HEALTHCHECK CMD wget -q -O /dev/null http://localhost:8080 || exit 1

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
[![Create Release](https://github.com/fullstack-devops/excalidraw/actions/workflows/create-release.yml/badge.svg)](https://github.com/fullstack-devops/excalidraw/actions/workflows/create-release.yml)
2+
[![Anchore Container Scan](https://github.com/fullstack-devops/excalidraw/actions/workflows/anchore.yml/badge.svg)](https://github.com/fullstack-devops/excalidraw/actions/workflows/anchore.yml)
3+
[![Docker Repository on Quay](https://quay.io/repository/fullstack-devops/excalidraw/status "Docker Repository on Quay")](https://quay.io/repository/fullstack-devops/excalidraw)
4+
15
# excalidraw
2-
Repo for rootless excalidraw in a secure nutshell
6+
Repo for rootless excalidraw in a secure nutshell ;)
7+
8+
## Where can I get it?
9+
10+
| Type | Registry | Link | Pull source |
11+
| ---- | ------------ | ----------------------------------------------------------------------------------- | -------------------------------------------- |
12+
| OCI | GitHub | [Package](https://github.com/fullstack-devops/excalidraw/pkgs/container/excalidraw) | `ghcr.io/fullstack-devops/excalidraw:latest` |
13+
| OCI | Red Hat Quay | [Repo](https://quay.io/repository/fullstack-devops/excalidraw?tab=info) | `quay.io/fullstack-devops/excalidraw:latest` |
14+
| helm | GitHub | [Repo](https://github.com/fullstack-devops/helm-charts) | `fs-devops/excalidraw` |
15+
16+
17+
more work tbd, eg.:
18+
- mount own libaries docker-compose and helm/k8s

0 commit comments

Comments
 (0)