Skip to content

Commit

Permalink
added workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
KryptonGuy committed Sep 16, 2024
1 parent 063ac70 commit 8fea3f4
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build

on:
push:
branches:
- main
- master
workflow_dispatch:

jobs:
BuildArtifactory:
name: Build Docker
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Artifactory
uses: docker/login-action@v3
with:
registry: ${{ vars.JF_URL }}
username: ${{ secrets.JFROG_USER_WRITER }}
password: ${{ secrets.JFROG_PASSWORD_WRITER }}
- name: Build and push Docker images
uses: docker/[email protected]
with:
push: true
tags: ${{ vars.REPO_URL }}

BuildDockerHub:
name: Build Docker
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/[email protected]
with:
push: true
tags: personal-portfolio:latest



18 changes: 16 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
FROM nginx:1.27-alpine-perl
FROM php:8.2-fpm-alpine

COPY . /usr/share/nginx/html
RUN apk --no-cache add nginx bash

COPY ./nginx.conf /etc/nginx/nginx.conf

COPY . /var/www/html

EXPOSE 80

RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html

COPY ./startscript.sh /start.sh
RUN chmod +x /start.sh

CMD ["/start.sh"]


41 changes: 41 additions & 0 deletions contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Requires the "PHP Email Form" library
* The "PHP Email Form" library is available only in the pro version of the template
* The library should be uploaded to: vendor/php-email-form/php-email-form.php
* For more info and help: https://bootstrapmade.com/php-email-form/
*/

// Replace [email protected] with your real receiving email address
$receiving_email_address = '[email protected]';

if( file_exists($php_email_form = '../assets/vendor/php-email-form/php-email-form.php' )) {
include( $php_email_form );
} else {
die( 'Unable to load the "PHP Email Form" Library!');
}

$contact = new PHP_Email_Form;
$contact->ajax = true;

$contact->to = $receiving_email_address;
$contact->from_name = $_POST['name'];
$contact->from_email = $_POST['email'];
$contact->subject = $_POST['subject'];

// Uncomment below code if you want to use SMTP to send emails. You need to enter your correct SMTP credentials
/*
$contact->smtp = array(
'host' => 'example.com',
'username' => 'example',
'password' => 'pass',
'port' => '587'
);
*/

$contact->add_message( $_POST['name'], 'From');
$contact->add_message( $_POST['email'], 'Email');
$contact->add_message( $_POST['message'], 'Message', 10);

echo $contact->send();
?>
29 changes: 29 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
worker_processes 1;
events { worker_connections 1024; }

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server {
listen 80;

root /var/www/html;
index index.php index.html;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
}
5 changes: 5 additions & 0 deletions startscript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

php-fpm -D

nginx -g "daemon off;"

0 comments on commit 8fea3f4

Please sign in to comment.