Skip to content

Commit c9cd50a

Browse files
committed
Publish manual and statistics using webdav
1 parent e086f2b commit c9cd50a

File tree

4 files changed

+19
-36
lines changed

4 files changed

+19
-36
lines changed

.github/workflows/manual.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ jobs:
88
name: Manual
99
uses: emacscollective/workflows/.github/workflows/manual.yml@main
1010
secrets:
11-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
12-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
11+
rclone_config: ${{ secrets.RCLONE_CONFIG }}

.github/workflows/stats.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ jobs:
99
name: Statistics
1010
uses: emacscollective/workflows/.github/workflows/stats.yml@main
1111
secrets:
12-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
13-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
12+
rclone_config: ${{ secrets.RCLONE_CONFIG }}

default.mk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
22

3+
DOMAIN ?= emacsmirror.org
4+
35
PKG = epkg
46

57
ELS = $(PKG).el
@@ -19,9 +21,6 @@ DEPS += llama
1921
DEPS += cond-let
2022
DEPS += magit/lisp
2123

22-
DOMAIN ?= emacsmirror.org
23-
CFRONT_DIST ?= E1IXJGPIOM4EUW
24-
2524
VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0 | cut -c2-)
2625
REVDESC := $(shell test -e $(TOP).git && git describe --tags)
2726

@@ -42,3 +41,6 @@ MANUAL_HTML_ARGS ?= --css-ref https://$(DOMAIN)/assets/page.css
4241
GITSTATS ?= gitstats
4342
GITSTATS_DIR ?= $(TOP)docs/stats
4443
GITSTATS_ARGS ?= -c style=https://$(DOMAIN)/assets/stats.css -c max_authors=999
44+
45+
RCLONE ?= rclone
46+
RCLONE_ARGS ?= -v

docs/Makefile

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,46 +52,29 @@ dir: $(PKG).info
5252
@printf "Generating $@\n"
5353
@texi2pdf --clean $< > /dev/null
5454

55-
PUBLISH_PATH ?= /manual/
56-
RELEASE_PATH ?= /manual/$(VERSION)/
57-
S3_BUCKET ?= s3://$(DOMAIN)
58-
PUBLISH_TARGET = $(S3_BUCKET)$(PUBLISH_PATH)
59-
RELEASE_TARGET = $(S3_BUCKET)$(RELEASE_PATH)
60-
CFRONT_PATHS = $(PKG).html $(PKG).pdf $(PKG)/*
61-
62-
comma := ,
63-
empty :=
64-
space := $(empty) $(empty)
55+
DOCS_DOMAIN = docs.$(DOMAIN)
56+
STAT_DOMAIN = stats.$(DOMAIN)
57+
SNAP_TARGET = $(subst .,_,$(DOCS_DOMAIN)):devel/$(PKG)/
58+
DOCS_TARGET = $(subst .,_,$(DOCS_DOMAIN)):$(PKG)/
59+
STAT_TARGET = $(subst .,_,$(STAT_DOMAIN)):$(PKG)/
6560

6661
publish: redo-docs
67-
@aws s3 cp $(PKG).html $(PUBLISH_TARGET)
68-
@aws s3 cp $(PKG).pdf $(PUBLISH_TARGET)
69-
@aws s3 sync $(PKG) $(PUBLISH_TARGET)$(PKG)/
70-
@printf "Generating CDN invalidation\n"
71-
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
72-
"$(subst $(space),$(comma),$(addprefix $(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null
62+
@printf "Publishing snapshot manual...\n"
63+
@cp $(PKG).pdf $(PKG)/$(PKG).pdf
64+
@$(RCLONE) sync $(RCLONE_ARGS) $(PKG) $(SNAP_TARGET)
7365

7466
release: redo-docs
75-
@aws s3 cp $(PKG).html $(RELEASE_TARGET)
76-
@aws s3 cp $(PKG).pdf $(RELEASE_TARGET)
77-
@aws s3 sync $(PKG) $(RELEASE_TARGET)$(PKG)/
78-
@aws s3 cp $(PUBLISH_TARGET)dir.html $(RELEASE_TARGET)dir.html
79-
@aws s3 cp $(PUBLISH_TARGET)dir/index.html $(RELEASE_TARGET)dir/index.html
80-
@printf "Generating CDN invalidation\n"
81-
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
82-
"$(subst $(space),$(comma),$(addprefix $(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null
67+
@printf "Publishing release manual...\n"
68+
@cp $(PKG).pdf $(PKG)/$(PKG).pdf
69+
@$(RCLONE) sync $(RCLONE_ARGS) $(PKG) $(DOCS_TARGET)
8370

8471
stats:
8572
@printf "Generating statistics...\n"
8673
@$(GITSTATS) $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
8774

8875
stats-upload:
8976
@printf "Uploading statistics...\n"
90-
@aws s3 sync $(GITSTATS_DIR) $(S3_BUCKET)/stats/$(PKG)
91-
@printf "Uploaded to $(S3_BUCKET)/stats/$(PKG)\n"
92-
@printf "Generating CDN invalidation\n"
93-
@aws cloudfront create-invalidation \
94-
--distribution-id $(CFRONT_DIST) --paths "/stats/*" > /dev/null
77+
@$(RCLONE) sync $(RCLONE_ARGS) stats $(STAT_TARGET)
9578

9679
CLEAN = $(PKG).info dir $(PKG) $(PKG).html $(PKG).pdf
9780

0 commit comments

Comments
 (0)