mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (ci): github action setup
This commit is contained in:
parent
a450238129
commit
1f76916840
2 changed files with 42 additions and 10 deletions
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
|
|
@ -35,7 +35,7 @@ jobs:
|
|||
path: server/ctrl/static/www/
|
||||
- uses: actions/setup-go@v3.5.0
|
||||
with:
|
||||
go-version: 1.20
|
||||
go-version: 1.19
|
||||
- name: Setup
|
||||
run: |
|
||||
mkdir -p ./dist/data/state/config
|
||||
|
|
@ -99,7 +99,7 @@ jobs:
|
|||
name: test
|
||||
- uses: actions/setup-go@v3.5.0
|
||||
with:
|
||||
go-version: 1.20
|
||||
go-version: 1.19
|
||||
- name: Setup
|
||||
run: |
|
||||
sudo apt-get install -y poppler-utils
|
||||
|
|
@ -125,6 +125,9 @@ jobs:
|
|||
run: |
|
||||
chmod +x filestash
|
||||
timeout 5 ./filestash > access.log || code=$?; if [[ $code -ne 124 ]]; then exit $code; fi
|
||||
echo "========= access.log "
|
||||
cat access.log
|
||||
echo "====================="
|
||||
cat access.log | grep -q "Filestash v0.5 starting"
|
||||
cat access.log | grep -q "listening on :"
|
||||
cat access.log | grep -vz "WARN"
|
||||
|
|
@ -177,10 +180,10 @@ jobs:
|
|||
run: |
|
||||
export COMMIT_SHA=`git rev-parse --short HEAD`
|
||||
cd docker
|
||||
docker build --tag machines/tmp:latest .
|
||||
docker tag machines/tmp:latest machines/tmp:$COMMIT_SHA
|
||||
docker push machines/tmp:latest
|
||||
docker push machines/tmp:$COMMIT_SHA
|
||||
docker build --tag machines/filestash:latest .
|
||||
docker tag machines/filestash:latest machines/filestash:$COMMIT_SHA
|
||||
docker push machines/filestash:latest
|
||||
docker push machines/filestash:$COMMIT_SHA
|
||||
|
||||
deploy:
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
|
|
|||
|
|
@ -13,13 +13,12 @@ RUN apk add make git && \
|
|||
make build_frontend
|
||||
|
||||
# STEP3: BUILD THE BACKEND
|
||||
FROM golang:1.20-stretch AS builder_backend
|
||||
FROM golang:1.19-buster AS builder_backend
|
||||
WORKDIR /home/
|
||||
COPY --from=builder_frontend /home/ ./
|
||||
RUN apt-get update > /dev/null && \
|
||||
apt-get install -y libvips-dev curl make > /dev/null 2>&1 && \
|
||||
go mod tidy && go mod vendor && \
|
||||
go generate -x ./server/... && \
|
||||
make build_init && \
|
||||
make build_backend && \
|
||||
mkdir -p ./dist/data/state/config/ && \
|
||||
cp config/config.json ./dist/data/state/config/config.json
|
||||
|
|
@ -31,7 +30,37 @@ COPY --from=builder_backend /home/dist/ /app/
|
|||
WORKDIR "/app"
|
||||
RUN apt-get update > /dev/null && \
|
||||
apt-get install -y --no-install-recommends apt-utils && \
|
||||
apt-get install -y emacs-nox ffmpeg zip poppler-utils > /dev/null
|
||||
apt-get install -y curl emacs-nox ffmpeg zip poppler-utils > /dev/null && \
|
||||
# org-mode: html export
|
||||
curl https://raw.githubusercontent.com/mickael-kerjean/filestash/master/server/.assets/emacs/htmlize.el > /usr/share/emacs/site-lisp/htmlize.el && \
|
||||
# org-mode: markdown export
|
||||
curl https://raw.githubusercontent.com/mickael-kerjean/filestash/master/server/.assets/emacs/ox-gfm.el > /usr/share/emacs/site-lisp/ox-gfm.el && \
|
||||
# org-mode: pdf export (with a light latex distribution)
|
||||
cd && apt-get install -y wget perl > /dev/null && \
|
||||
export CTAN_REPO="http://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet" && \
|
||||
curl -sL "https://yihui.name/gh/tinytex/tools/install-unx.sh" | sh && \
|
||||
mv ~/.TinyTeX /usr/share/tinytex && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install wasy && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install ulem && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install marvosym && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install wasysym && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install xcolor && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install listings && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install parskip && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install float && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install wrapfig && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install sectsty && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install capt-of && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install epstopdf-pkg && \
|
||||
/usr/share/tinytex/bin/x86_64-linux/tlmgr install cm-super && \
|
||||
ln -s /usr/share/tinytex/bin/x86_64-linux/pdflatex /usr/local/bin/pdflatex && \
|
||||
apt-get purge -y --auto-remove perl wget && \
|
||||
# Cleanup
|
||||
find /usr/share/ -name 'doc' | xargs rm -rf && \
|
||||
find /usr/share/emacs -name '*.pbm' | xargs rm -f && \
|
||||
find /usr/share/emacs -name '*.png' | xargs rm -f && \
|
||||
find /usr/share/emacs -name '*.xpm' | xargs rm -f
|
||||
|
||||
RUN useradd filestash && \
|
||||
chown -R filestash:filestash /app/ && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
|
|
|
|||
Loading…
Reference in a new issue