This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
-
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
0 parents
commit f98c571
Showing
5 changed files
with
100 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,51 @@ | ||
name: pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
wordpress_deployment: | ||
name: Wordpress Deployment | ||
runs-on: ubuntu-latest | ||
environment: Production | ||
|
||
env: | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
SPACE_NAME: wp-nginx-test | ||
HF_USERNAME: qywok | ||
|
||
steps: | ||
- name: Set global directory | ||
run: git config --global --add safe.directory /github/workspace | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 1000 | ||
|
||
- name: Check git status | ||
run: git status | ||
|
||
- name: Configure git | ||
run: | | ||
git config --local user.email "alfariqyraihan@gmail.com" | ||
git config --local user.name "qywok" | ||
- name: Pull changes from remote | ||
run: | | ||
git pull https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main || \ | ||
(git merge --strategy-option theirs) | ||
- name: Add and commit changes | ||
run: | | ||
git add -A | ||
git diff-index --quiet HEAD || git commit -m "Wordpress Deployment" | ||
- name: Push to Hugging Face | ||
run: | | ||
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main --force |
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 @@ | ||
credentials |
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,16 @@ | ||
FROM php:7.4-fpm-alpine | ||
|
||
RUN apk --no-cache add nginx | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
RUN mkdir -p /run/nginx | ||
|
||
RUN mkdir -p /var/www/html && echo "<?php phpinfo(); ?>" > /var/www/html/index.php | ||
|
||
EXPOSE 7860 | ||
|
||
COPY start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
|
||
CMD ["/start.sh"] |
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,28 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 7860; | ||
server_name localhost; | ||
|
||
root /var/www/html; | ||
index index.php index.html; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
|
||
location ~ \.php$ { | ||
include fastcgi_params; | ||
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
} | ||
|
||
location ~ /\.ht { | ||
deny all; | ||
} | ||
} | ||
} |
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 @@ | ||
#!/bin/sh | ||
|
||
php-fpm & | ||
nginx -g 'daemon off;' |