Skip to content

Commit

Permalink
build master image. implements #2
Browse files Browse the repository at this point in the history
The Dockerfile now accepts either official version numbers or any github
branch or tag. The github action now also builds an image for the
current master.
  • Loading branch information
splitbrain committed May 16, 2024
1 parent 2d7c8ed commit b09adcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
- name: Set up matrix
id: set-matrix
run: |
echo "matrix=$(curl https://download.dokuwiki.org/version | jq -c 'del(.master) | {release: [.[]]}')" >> $GITHUB_OUTPUT
echo "matrix=$(curl https://download.dokuwiki.org/version | jq -c '{release: [.[]]}')" >> $GITHUB_OUTPUT
build:
needs: buildmatrix
name: Build Docker Image ${{ matrix.release.date }}
name: Build Docker Image for ${{ matrix.release.type }}
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.buildmatrix.outputs.matrix)}}
Expand Down Expand Up @@ -45,8 +45,8 @@ jobs:
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
tags: |
dokuwiki/dokuwiki:${{ matrix.release.date }}
${{ matrix.release.type == 'master' && ' ' || format('dokuwiki/dokuwiki:{0}', matrix.release.date) }}
dokuwiki/dokuwiki:${{ matrix.release.type }}
${{ matrix.release.type == 'stable' && 'dokuwiki/dokuwiki:latest' || '' }}
build-args: |
DOKUWIKI_VERSION=${{ matrix.release.date }}
DOKUWIKI_VERSION=${{ matrix.release.type == 'master' && 'master' || matrix.release.date }}
9 changes: 6 additions & 3 deletions root/build-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ a2disconf security
a2enmod rewrite
a2enmod xsendfile

# Install DokuWiki
curl -L "https://download.dokuwiki.org/src/dokuwiki/dokuwiki-${DOKUWIKI_VERSION}.tgz" \
| tar xz --strip-components 1 -C /var/www/html
# Download DokuWiki from the official website or from GitHub
curl --fail -L "https://download.dokuwiki.org/src/dokuwiki/dokuwiki-${DOKUWIKI_VERSION}.tgz" -o dokuwiki.tgz || \
curl --fail -L "https://github.com/dokuwiki/dokuwiki/archive/refs/heads/master.tar.gz" -o dokuwiki.tgz

# Extract DokuWiki to the web root
tar xzf dokuwiki.tgz --strip-components 1 -C /var/www/html && rm dokuwiki.tgz

# Create volume mount point
mkdir /storage
Expand Down

0 comments on commit b09adcd

Please sign in to comment.