Skip to content

Commit

Permalink
Make it multi arch and add a publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Oct 11, 2023
1 parent 4b35f14 commit 28bb2e5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/doctum.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: build doctum docs

permissions:
contents: read

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build doctum docs
uses: sudo-bot/action-doctum@latest
with:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Docker image

permissions:
contents: read

on:
push:
tags:
- "latest"

jobs:
push_to_registry:
name: Push Docker image to Docker hub
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }}
password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}
- name: Build action image
run: make docker-build
env:
IMAGE_TAG: "docker.io/botsudo/action-doctum:latest"
PLATFORM: "linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6"
23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
.PHONY: update-tags docker-build
IMAGE_TAG ?= action-doctum

# All: linux/amd64,linux/arm64/v8,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
PLATFORM ?= linux/amd64

ACTION ?= load
PROGRESS_MODE ?= plain

.PHONY: update-tags update-branches push-branches docker-build docker-push

docker-build:
docker build ./docker \
# https://github.com/docker/buildx#building
docker buildx build \
--tag $(IMAGE_TAG) \
--progress $(PROGRESS_MODE) \
--platform $(PLATFORM) \
--build-arg VCS_REF=`git rev-parse HEAD` \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--$(ACTION) \
./docker

docker-push:
docker push $(IMAGE_TAG)

update-tags:
git checkout 5.x
Expand Down

0 comments on commit 28bb2e5

Please sign in to comment.