Pages provider not deploying svg files

Hi,

I have a project that builds an html site (using rust mdBook, plus scripts to generate .svg files) in target/html directory and then uploaded it to gh pages using the pages provider from my .travis.yml

It’s copying the html, js and png files - but it doesn’t seem to be deploying to the gh-pages branch the SVG files in the same folder.

Is there a way to force certain files type to be deployed to the gh-pages branch?

Here is my deploy script:

deploy:
  provider: pages
  skip-cleanup: true
  github-token: $GITHUB_PAGES_TOKEN
  local-dir: target/html
  keep-history: false
  on:
    branch: master

List of files in target folder to be deployed:

ls target/html/samples/prime
DESCRIPTION.html                generate_composites.dot.svg
candidates.dot.svg              generate_composites.toml
composite-sequence.dot.svg      manifest.json
composites.dot.svg              prime.dot.svg
composites.toml                 print_all.toml
context.toml                    remainder_zero.toml
divisors.dot.svg                test.arguments
even.toml                       test.err
expected.output                 test.input
functions.dot.svg

Sample GH page: http://andrewdavidmackenzie.github.io/flow/samples/prime/DESCRIPTION.html

GH pages branch for that folder: https://github.com/andrewdavidmackenzie/flow/tree/gh-pages/samples/prime that lacks the svg files listed above, but it does include some other file types like .toml.

Here is the build/deploy run on master that did the gh pages deploy: https://travis-ci.org/github/andrewdavidmackenzie/flow
It’s not very verbose in the deploy section to help understand what is included and what not.

Any ideas?

I admit that I’m a little confused here.

You are ignoring target directory

so I’d expect that the entirety of target directory would be ignored by the deployment (because it uses git push to accomplish the job, as explained in https://docs.travis-ci.com/user/deployment/pages), but your deployment commit


appears to have a lot of stuff.

1 Like

And it gets updated. I recently updated the docs to refer to the SVG image (was png before) and the pages reflect that - so it’s deploying updates to content to the ghpages branch…

That commit is the “first ghpages” deploy (by Travis I think) to ghpages from master - I haven’t done any manually (that I know of)

The docs are built into the target (like “out” directory examples) folder, and are not source assets, so they should be ignored for normal source control.

My understanding is: The deploy provider takes the code in the local-dir: target/html folder and git push --force pushes it to the root folder (not under target/) on the GH pages branch - as you can see here https://github.com/andrewdavidmackenzie/flow/tree/gh-pages. You can see the index.html file from target/html/index.html is in the root folder.

If I execute this myself by hand

	@git worktree prune
	@rm -rf /tmp/guide
	git worktree add /tmp/guide gh-pages
	rm -rf /tmp/guide/*
	cp -rp target/html/* /tmp/guide/
	cd /tmp/guide && \
		git add -A && \
		git commit -m "deployed on $(shell date) by ${USER}" && \
		git push --force origin gh-pages

then it all works fine. gh-pages branch now contains the SVG files I’d like.