Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PORT=80
#MW_SITE_SERVER=http://localhost:80
MW_SITE_NAME=MyWiki
MW_SITE_LANG=en
MW_ENABLE_UPLOADS=1
MW_USE_INSTANT_COMMONS=0
MW_AUTOUPDATE=true
MW_MAIN_CACHE_TYPE=CACHE_NONE
MW_LOAD_SKINS=Vector
MW_DEFAULT_SKIN=vector
MW_LOAD_EXTENSIONS=ParserFunctions
MW_USE_CACHE_DIRECTORY=
MW_SHOW_EXCEPTION_DETAILS=true
MW_USE_IMAGE_MAGIC=
MW_MEMCACHED_SERVERS=
MW_PROXY_SERVERS=
MW_FLOW_NAMESPACES=
MW_ENABLE_SITEMAP_GENERATOR=


MW_ADMIN_USER=admin
MW_ADMIN_PASS=rand0mmysqlpassw0rd1!

MW_DB_INSTALLDB_PASS=mediawiki
MW_DB_TYPE=mysql

MW_DB_NAME=mediawiki
MW_DB_PASS=mediawiki
MW_SECRET_KEY=jf843y8973098waujda9odu89seyf9s4fy98sof49gyh47e3w9yhf9os

MW_ENABLE_EMAIL=false
MW_ENABLE_USER_EMAIL=false
MW_EMERGENCY_CONTACT=apache@invalid
MW_PASSWORD_SENDER=apache@invalid
77 changes: 77 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: DeployerBot

on:
pull_request:
types: [ labeled, synchronize, reopened ]
workflow_call:
inputs: {}
secrets: {}
##concurrency: docker_compose_ngrok_free
jobs:
deploy-tunnel:
if: contains(github.event.pull_request.labels.*.name, 'deploy')
runs-on: ubuntu-latest
permissions:
deployments: write
pull-requests: write
actions: write
statuses: write
checks: write
steps:

- name: Fetch check run ids
id: fetch
uses: octokit/request-action@v2.x
with:
route: GET /repos/{repo}/commits/{sha}/check-runs
repo: ${{ github.repository }}
run_id: ${{ github.run_id }}
sha: ${{github.event.pull_request.head.sha || github.sha}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Echo check run ids
run: echo "job ids - ${{ toJSON(fromJSON(steps.fetch.outputs.data).check_runs[0].id) }}"

# - name: Script
# uses: actions/github-script@v6
# id: my-script
# with:
# result-encoding: string
# retries: 1
# script: |
# github.rest.checks.listForRef({
# owner: context.repo.owner,
# ref: context.ref,
# repo: context.repo.repo,
# check_name: 'deploy-tunnel'
# })
#
# - name: Get result
# run: echo "${{steps.my-script.outputs.result}}"

- name: Confirm check
uses: LouisBrunner/checks-action@v1.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: 'neutral'
check_id: ${{ toJSON(fromJSON(steps.fetch.outputs.data).check_runs[0].id) }}
status: 'completed'

- name: Deploy and tunnel
uses: wikiteq/compose-deploy-tunnel-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
secret: ${{ secrets.BORE_TOKEN }}
endpoint: stage-deploy.wikiteq.com
port: 80
file: docker-compose.yml

- name: Confirm check
uses: LouisBrunner/checks-action@v1.1.1
if: cancelled()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: 'neutral'
check_id: ${{ toJSON(fromJSON(steps.fetch.outputs.data).check_runs[0].id) }}
status: 'skipped'
71 changes: 71 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: '3.1'
services:
db:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password --expire_logs_days=3
cap_add:
- SYS_NICE # CAP_SYS_NICE, fix error mbind: Operation not permitted
restart: unless-stopped
environment:
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD=${MW_DB_INSTALLDB_PASS:-mediawiki}
- MYSQL_DATABASE=${MW_DB_NAME:-mediawiki}
volumes:
- initdb:/docker-entrypoint-initdb.d
- mysql:/var/lib/mysql

web:
build:
context: .
dockerfile: Dockerfile
args:
COMPOSER_TOKEN: ${COMPOSER_TOKEN:-}
restart: unless-stopped
ports:
- "${PORT:-127.0.0.1:8081}:80"
links:
- db
environment:
- MW_ADMIN_USER=${MW_ADMIN_USER:-admin}
- MW_ADMIN_PASS=${MW_ADMIN_PASS:-Passsw0rd!}
- MW_DB_NAME=${MW_DB_NAME:-mediawiki}
- MW_DB_INSTALLDB_USER=root
- MW_DB_INSTALLDB_PASS=${MW_DB_INSTALLDB_PASS:-mediawiki}
- MW_DB_USER=root
- MW_DB_PASS=${MW_DB_PASS:-mediawiki}
- MW_SECRET_KEY
- MW_SITE_SERVER
- MW_SITE_NAME
- MW_SITE_LANG
- MW_ENABLE_UPLOADS
- MW_USE_INSTANT_COMMONS
- MW_AUTOUPDATE
- MW_MAIN_CACHE_TYPE
- MW_LOAD_SKINS=${MW_LOAD_SKINS:-Vector,chameleon}
- MW_DEFAULT_SKIN=${MW_DEFAULT_SKIN:-chameleon}
- MW_LOAD_EXTENSIONS=${MW_LOAD_EXTENSIONS:-ParserFunctions,WikiEditor}
- MW_ENABLE_EMAIL
- MW_ENABLE_USER_EMAIL
- MW_EMERGENCY_CONTACT
- MW_PASSWORD_SENDER
- MW_DB_TYPE=${MW_DB_TYPE:-mysql}
- MW_USE_CACHE_DIRECTORY
- MW_SHOW_EXCEPTION_DETAILS
- MW_MEMCACHED_SERVERS
- MW_PROXY_SERVERS
- MW_FLOW_NAMESPACES
- MW_SEARCH_TYPE
- MW_ENABLE_SITEMAP_GENERATOR
- MW_CIRRUS_SEARCH_SERVERS
- PHP_UPLOAD_MAX_FILESIZE=500M
- PHP_POST_MAX_SIZE=500M
- MW_DEBUG_MODE
volumes:
- mediawiki:/mediawiki
- settings:/var/www/mediawiki/w/_settings

volumes:
mediawiki:
mysql:
initdb:
settings: