Skip to content

Commit

Permalink
Add build functionality to github-pages executable (#798)
Browse files Browse the repository at this point in the history
Add Publish to Docker Workflow
  • Loading branch information
jriggins authored Nov 16, 2021
1 parent 51387a1 commit 99b4fb6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to Docker
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]

env:
DOCKER_TAG_IMAGE: "ghcr.io/github/pages-gem"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Get Docker Metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_TAG_IMAGE }}

- name: Build Docker Image
run: |
docker build -t ${{ steps.meta.outputs.tags }} -f Dockerfile .
- name: Push to Container Registry
if: github.event_name != 'pull_request'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login -u ${{ github.actor }} https://ghcr.io --password-stdin
docker push ${{ steps.meta.outputs.tags }}
13 changes: 13 additions & 0 deletions bin/github-pages
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,17 @@ Mercenary.program(:"github-pages") do |p|
end
end
end

p.command(:build) do |c|
c.syntax "build [options]"
c.description "Builds your Jekyll site"

c.option 'verbose', '--verbose', 'Verbose logging'
c.option 'source', '--source DIR', 'From where to collect the source files'
c.option 'destination', '--destination DIR', 'To where the compiled files should be written'

c.action do |_, options|
Jekyll::Commands::Build.process(options)
end
end
end

0 comments on commit 99b4fb6

Please sign in to comment.