Skip to content

Commit

Permalink
v1.210.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGiddyLimit committed Sep 14, 2024
1 parent 7c839b4 commit c36cc41
Show file tree
Hide file tree
Showing 8 changed files with 1,554 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
*

!docker

!adventure
!backgrounds
!bestiary
!book
!characters
!charcreationoptions
!classes
!conditionsdiseases
!covers
!decks
!deities
!dmscreen
!feats
!items
!languages
!objects
!pdf
!plutonium
!races
!recipes
!spells
!traps
!variantrules
!vehicles

!*.webp
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*]
charset=utf-8
end_of_line=lf
trim_trailing_whitespace=true
insert_final_newline=true
indent_style=tab
indent_size=3
28 changes: 26 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
*.webp -text
*.pdf -text
*.js text eol=lf
*.cjs text eol=lf
*.mjs text eol=lf
*.json text eol=lf
*.html text eol=lf
*.scss text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.sh text eol=lf
*.css text eol=lf
*.xml text eol=lf
*.svg text eol=lf
*.hbs text eol=lf
*.txt text eol=lf

.dockerignore text eol=lf
.editorconfig text eol=lf
.gitattributes text eol=lf
.gitignore text eol=lf
.eslintignore text eol=lf
.eslintrc.cjs text eol=lf
.gitmodules text eol=lf
.node-version text eol=lf
manifest.webmanifest text eol=lf
docker/*.conf text eol=lf
Dockerfile text eol=lf
74 changes: 74 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Upload Release

on:
push:
tags:
- 'v**'

# Allow running manually from the actions tab
workflow_dispatch:

env:
# See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
IMAGE_NAME: 5etools-img

concurrency:
group: "release"
cancel-in-progress: true

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Archive Images
run: |
rm -rf docker Dockerfile
mkdir -p img
ls | grep -v img | xargs mv -t img
zip -r -s 500m img-${{ github.ref_name }}.zip img/
- name: Upload Release
# Add the files one-by-one in an effort to avoid timeouts
# Sleep between creating the release and adding files, as the release takes time to be created (?)
run: |
gh release create "${{github.ref_name}}" --title "${{github.ref_name}}" --notes "Version ${{ github.ref_name }}"
sleep 10
for f in $(find . -name 'img-${{ github.ref_name }}.*' -print); do gh release upload ${{ github.ref_name }} $f; done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

create-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

# See: https://stackoverflow.com/a/58178121
- name: Set Env
run: |
IMAGE_VERSION=${{ github.ref_name }}
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && IMAGE_VERSION=$(echo $IMAGE_VERSION | sed -e 's/^v//')
echo "IMAGE_VERSION=$IMAGE_VERSION" >> $GITHUB_ENV
echo "IMAGE_ID=$(echo ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
# region See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
- name: Build Image
run: |
docker build -t $IMAGE_NAME .
- name: Log In to Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push Image
run: |
echo IMAGE_ID=$IMAGE_ID
echo IMAGE_VERSION=$IMAGE_VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$IMAGE_VERSION
# Always tag latest when pushing a tag, as we don't expect to ever merge old tags
[[ "${{ github.ref }}" == "refs/tags/"* ]] && docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:$IMAGE_VERSION
docker push $IMAGE_ID:latest
# endregion
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
desktop.ini
node_modules
img

# IntelliJ project files
.idea/
*.iml
desktop.ini

# Visual Studio Code project files
.vscode/

# Misc dev/scripting files
trash
trash_in
node_

# Generated files
sitemap.xml
*.DS_Store
Thumbs.db
.rsync-filter

# Generated service worker files
sw.js
sw-injector.js

# Log files
*.log
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine

RUN apk update && apk add lighttpd rsync

CMD [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ]
EXPOSE 80

WORKDIR /var/www/localhost/htdocs

COPY . img/

RUN mv img/docker/lighttpd.conf img/docker/mime-types.conf /etc/lighttpd/ && rm -rf img/docker/
10 changes: 10 additions & 0 deletions docker/lighttpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server.document-root = "/var/www/localhost/htdocs"

server.port = 80

server.username = "lighttpd"
server.groupname = "lighttpd"

include "/etc/lighttpd/mime-types.conf"

index-file.names = ("index.html")
Loading

0 comments on commit c36cc41

Please sign in to comment.