-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
426738a
commit 81ceaa2
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'Build wordpress images' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
paths: | ||
- images/nginx/**/* | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/actions/login-ghcr | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: ./.github/actions/build-push | ||
with: | ||
registry: ghcr.io | ||
cache-mode: 'min' | ||
context: images/wordpress-nginx | ||
image: myparcelnl/wordpress-nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nginx:1-alpine | ||
|
||
# Copy nginx config | ||
COPY ./etc/nginx/templates/* /etc/nginx/templates/ |
45 changes: 45 additions & 0 deletions
45
images/wordpress-nginx/etc/nginx/templates/default.conf.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
server { | ||
set $site_url "${BASE_URL}"; | ||
set $root_dir "${ROOT_DIR}"; | ||
|
||
server_name $site_url; | ||
root $root_dir; | ||
|
||
index index.php; | ||
|
||
location = /favicon.ico { | ||
log_not_found off; | ||
access_log off; | ||
} | ||
|
||
location = /robots.txt { | ||
allow all; | ||
log_not_found off; | ||
access_log off; | ||
} | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
fastcgi_pass ${PHP_FPM_HOST}:${PHP_FPM_PORT}; | ||
include fastcgi_params; | ||
fastcgi_intercept_errors on; | ||
#The following parameter can be also included in fastcgi_params file | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
} | ||
|
||
location ~ \.(js|mjs|cjs)$ { | ||
default_type application/x-javascript; | ||
} | ||
|
||
location /wp-json/ { | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
|
||
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | ||
expires max; | ||
log_not_found off; | ||
} | ||
} |