Keval Bhogayata
Keval Bhogayata

Reputation: 6736

Serve APT repo with Aptly + Github Pages

I have created one APT repo using aptly

The repo works well on my local. But I want to host this APT repo via Github Pages

Say, My github repo is abc.xyz.io which is also my domain name My apt content is at abc.xyz.io/apt-repo

How do I setup my aptly.conf accordingly ?

Can FileSystemPublishEndpoints help ?

Upvotes: 3

Views: 125

Answers (1)

cavcrosby
cavcrosby

Reputation: 5

I had similar needs and managed to put something together, so hopefully my experience can help.

The recent repository I created to publish an apt repository with GitHub Pages had the following .aptly.conf file configuration for FileSystemPublishEndpoints.

{
  ...
  "FileSystemPublishEndpoints": {
    "kubectl-pkg-repo": {
      "rootDir": "./"
    }
  }
}

The rootDir configuration within the kubectl-pkg-repo endpoint just uses the root of the git repository so that I can specify an explicit prefix on the endpoint. For example, I wanted to publish the apt repository's contents in a directory called deb at the root of the git repository. So I specified the filesystem endpoint as filesystem:kubectl-pkg-repo:deb to numerous aptly commands.

I push my code to GitHub, then let GitHub Actions publish the apt repository's contents (via aptly publish repo) into the git repository and push those changes to a separate branch named gh-pages. This branch is where GitHub Pages publishes my repository from, but is a setting I had to configure within the repository's GitHub Pages settings.

Upvotes: 0

Related Questions