Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Deploy WordPress on HuggingFace
Browse files Browse the repository at this point in the history
  • Loading branch information
belajarqywok committed Sep 26, 2024
0 parents commit 7428bdb
Show file tree
Hide file tree
Showing 3,015 changed files with 1,328,884 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
51 changes: 51 additions & 0 deletions .github/workflows/pipelines.yaml
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
credentials
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM php:8.1-cli

WORKDIR /app

COPY . .

RUN docker-php-ext-install mysqli

CMD ["php", "-S", "0.0.0.0:7860"]

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: WordPress Testing
emoji: 🌐
colorFrom: purple
colorTo: blue
sdk: docker
pinned: false
---
17 changes: 17 additions & 0 deletions apache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<VirtualHost *:7860>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

ServerName localhost

Listen 7860
17 changes: 17 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );

/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
Loading

0 comments on commit 7428bdb

Please sign in to comment.