Skip to content

Commit 9b7e439

Browse files
committed
How to setup php project
1 parent 8f9fa03 commit 9b7e439

13 files changed

+162
-434
lines changed

.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PUBLIC_GOOGLE_SITE_VERIFICATION=7vlGZmcQOc0US8lHfVRJnE_w0zaDoEif0NXLD6Fh6rw
2+

.github/workflows/deploy.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: cache
21+
id: cache-frontend
22+
uses: actions/cache@v3
23+
with:
24+
key: frontend-$NODE_ENV-${{ hashFiles('**/package-lock.json') }}
25+
path: |
26+
node_modules
27+
restore-keys: |
28+
frontend-$NODE_ENV-
29+
frontend-
30+
31+
- run: npm install
32+
33+
deploy:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
deployments: write
38+
pull-requests: write
39+
needs: build
40+
name: Deploy
41+
env:
42+
NODE_ENV: production
43+
outputs:
44+
preview_url: ${{ steps.cloudflare-deploy.outputs.url }}
45+
steps:
46+
- uses: actions/checkout@v3
47+
- uses: actions/setup-node@v3
48+
with:
49+
node-version: 19
50+
51+
- uses: actions/cache@v3
52+
with:
53+
key: frontend-$NODE_ENV-${{ hashFiles('**/package-lock.json') }}
54+
path: |
55+
node_modules
56+
restore-keys: |
57+
frontend-$NODE_ENV-
58+
frontend-
59+
60+
- run: npm run build
61+
62+
- name: Deploy
63+
id: cloudflare-deploy
64+
uses: cloudflare/pages-action@1
65+
with:
66+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
67+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
68+
projectName: erison-work # e.g. 'my-project'
69+
directory: dist # e.g. 'dist'
70+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
71+
72+
comment:
73+
runs-on: ubuntu-latest
74+
needs:
75+
- deploy
76+
name: Add comment in Pull request
77+
steps:
78+
- name: Comment PR
79+
if: github.event_name == 'pull_request'
80+
uses: mshick/add-pr-comment@v2
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
PREVIEW_URL: ${{ steps.cloudflare-deploy.outputs.url }}
84+
with:
85+
message: |
86+
🚀 This branch can be previewed at ${{ needs.deploy.outputs.preview_url }}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pnpm-debug.log*
1313

1414

1515
# environment variables
16-
.env
16+
# .env
1717
.env.production
1818

1919
# macOS-specific files

.vscode/extensions.json

-4
This file was deleted.

.vscode/launch.json

-11
This file was deleted.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ All commands are run from the root of the project, from a terminal:
174174

175175
> **_Warning!_** Windows PowerShell users may need to install the [concurrently package](https://www.npmjs.com/package/concurrently) if they want to [run diagnostics](https://docs.astro.build/en/reference/cli-reference/#astro-check) during development (`astro check --watch & astro dev`). For more info, see [this issue](https://github.com/satnaing/astro-paper/issues/113).
176176
177+
> Warning! Windows PowerShell users may need to install the [concurrently package](https://www.npmjs.com/package/concurrently) if they want to [run diagnostics](https://docs.astro.build/en/reference/cli-reference/#astro-check) during development (`astro check --watch & astro dev`). For more info, see [this issue](https://github.com/satnaing/astro-paper/issues/113).
178+
177179
## ✨ Feedback & Suggestions
178180

179181
If you have any suggestions/feedback, you can contact me via [my email](mailto:[email protected]). Alternatively, feel free to open an issue if you find bugs or want to request new features.

public/assets/dev.svg

-361
This file was deleted.
Loading

src/config.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { Site, SocialObjects } from "./types";
22

33
export const SITE: Site = {
4-
website: "https://astro-paper.pages.dev/", // replace this with your deployed domain
5-
author: "Sat Naing",
6-
profile: "https://satnaing.dev/",
7-
desc: "A minimal, responsive and SEO-friendly Astro blog theme.",
8-
title: "AstroPaper",
4+
website: "https://blog.erison.work",
5+
profile: "https://blog.erison.work", // TODO: I do not know why we need this
6+
author: "Erison Silva",
7+
desc: "It's my personal blog, here I'm posting techinical posts and things that I consider intersting to share.",
8+
title: "erison.work",
99
ogImage: "astropaper-og.jpg",
1010
lightAndDarkMode: true,
1111
postPerIndex: 4,
@@ -28,33 +28,33 @@ export const LOGO_IMAGE = {
2828
export const SOCIALS: SocialObjects = [
2929
{
3030
name: "Github",
31-
href: "https://github.com/satnaing/astro-paper",
31+
href: "https://github.com/eerison",
3232
linkTitle: ` ${SITE.title} on Github`,
3333
active: true,
3434
},
3535
{
3636
name: "Facebook",
3737
href: "https://github.com/satnaing/astro-paper",
3838
linkTitle: `${SITE.title} on Facebook`,
39-
active: true,
39+
active: false,
4040
},
4141
{
4242
name: "Instagram",
4343
href: "https://github.com/satnaing/astro-paper",
4444
linkTitle: `${SITE.title} on Instagram`,
45-
active: true,
45+
active: false,
4646
},
4747
{
4848
name: "LinkedIn",
49-
href: "https://github.com/satnaing/astro-paper",
49+
href: "https://www.linkedin.com/in/eerison",
5050
linkTitle: `${SITE.title} on LinkedIn`,
5151
active: true,
5252
},
5353
{
5454
name: "Mail",
55-
href: "mailto:yourmail@gmail.com",
55+
href: "mailto:hey@gmail.com",
5656
linkTitle: `Send an email to ${SITE.title}`,
57-
active: false,
57+
active: true,
5858
},
5959
{
6060
name: "Twitter",

src/content/blog/adding-new-post.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ modDatetime: 2023-12-21T09:12:47.400Z
55
title: Adding new posts in AstroPaper theme
66
slug: adding-new-posts-in-astropaper-theme
77
featured: true
8-
draft: false
8+
draft: true
99
tags:
1010
- docs
1111
description:
1212
Some rules & recommendations for creating or adding new posts using AstroPaper
1313
theme.
1414
---
1515

16-
Here are some rules/recommendations, tips & ticks for creating new posts in AstroPaper blog theme.
16+
### Soon I will update this post
1717

1818
## Table of contents
1919

src/content/blog/how-to-setup-php-easily-on-your-machine.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ tags:
1010
- developer
1111
- beginner
1212
- setup
13-
ogImage: https://blog.erison.work/_astro/how-to-setup-php-easily-on-your-machine.2b7537c4_Z6cLXe@3540w.jpeg
1413
description: The easiest way to setup whole PHP stack locally with one command only.
1514
---
1615

17-
![An astronauta carring a laptop](@assets/images/how-to-setup-php-easily-on-your-machine.jpg)
18-
1916
My goal with this post is you have a _PHP environment_ running on your machine quickly and easy.
2017
I saw some people struggling to have this done, and tutorials that you need to follow a bunch of steps
2118
for the end, you could run PHP on command line only 😔.
2219

2320
But on sections bellow, you going to find a setup with one **copy** and **past** command, and _you have a complete php stack running_
2421
with a small php structure for you use as study guide in case, you are new on php land.
2522

26-
# Requirements
23+
## Requirements
2724

2825
Before we start, you **MUST** have two tools already installed on your computer.
2926

@@ -45,7 +42,7 @@ docker compose version
4542

4643
> For **Windows** users I would say that you must install [WSL][wsl_install_link] to have this working.
4744
48-
# Let's make this work 🚀
45+
## Let's make this work 🚀
4946

5047
After you have done the requirements step, we can now run command to have this ready to play with php 🐘.
5148

@@ -65,7 +62,7 @@ git clone https://github.com/shield-wall/easy-php-setup.git \
6562
&& docker compose exec -T db sh -c 'exec mysql --defaults-extra-file=.docker/mysql/config.cnf' < .docker/mysql/dump.sql
6663
```
6764

68-
# Troubleshooting
65+
## Troubleshooting
6966

7067
In case the error bellow pop up on your terminal.
7168

@@ -92,15 +89,15 @@ docker compose exec -T db sh -c 'exec mysql --defaults-extra-file=.docker/mysql/
9289

9390
> In case you find out other issue that is not related here, open an [issue][repository_issue_link] on github.
9491
95-
# Commands
92+
## Commands
9693

9794
| Command | Description |
9895
| ---------------------------------------- | -------------------------------------------------------------------- |
9996
| docker compose up -d | Start the containers |
10097
| docker compose down | Stop containers |
10198
| docker compose exec php composer install | Execute some **php command** that you need, or **composer command**. |
10299

103-
# Frameworks
100+
## Frameworks
104101

105102
This project should work, out the box, for the most _modern php frameworks_ such as [Symfony][symfony_link] and [Laravel][laravel_link].
106103

@@ -109,7 +106,7 @@ In case you just want to use the environment, you can remove all files and keep
109106
But if you find some strange behaviour, feel free to open an [issue][repository_issue_link]
110107
or even better provide a PR to improve the [project][repository_link] 🚀.
111108

112-
# Study guide
109+
## Study guide
113110

114111
As you can see I added a tiny php structure, I did this for two reasons.
115112

src/pages/about.md

+46-22
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,58 @@ layout: ../layouts/AboutLayout.astro
33
title: "About"
44
---
55

6-
AstroPaper is a minimal, responsive and SEO-friendly Astro blog theme. I designed and crafted this based on [my personal blog](https://satnaing.dev/blog).
6+
Hello Hello,
77

8-
This theme is aimed to be accessible out of the box. Light and dark mode are supported by
9-
default and additional color schemes can also be configured.
8+
I'm Erison Silva and I've been working in the past 10 years as Software developer.
109

11-
This theme is self-documented \_ which means articles/posts in this theme can also be considered as documentations. So, see the documentation for more info.
10+
## 📋 Resume
1211

13-
<div>
14-
<img src="/assets/dev.svg" class="sm:w-1/2 mx-auto" alt="coding dev illustration">
15-
</div>
12+
Here you can download my last [resume](https://bucket.myprofile.pro/users/eerison/resume-default.pdf) version.
1613

17-
## Tech Stack
14+
## ♥️ Open Source
1815

19-
This theme is written in vanilla JavaScript (+ TypeScript for type checking) and a little bit of ReactJS for some interactions. TailwindCSS is used for styling; and Markdown is used for blog contents.
16+
Open source has been a topic that I always want to be be involved, and in Octuber 2020 I did my first Pull request for [Sonata User Bundle][first_pr_sonata_user]!
17+
and Since there I ejoyed more and more contribute with OSS projects, Thanks Sonata Project for be so receptive and helpfull in my first contribuition <3.
2018

21-
## Features
19+
### Myprofile project
2220

23-
Here are certain features of this site.
21+
[Myprofile][myprofile_project], It is a open source project mantained by me, and I will dedicate a article just for this, it commes soon.
2422

25-
- fully responsive and accessible
26-
- SEO-friendly
27-
- light & dark mode
28-
- fuzzy search
29-
- super fast performance
30-
- draft posts
31-
- pagination
32-
- sitemap & rss feed
33-
- highly customizable
23+
### Sonata page bundle 4
3424

35-
If you like this theme, you can star/contribute to the [repo](https://github.com/satnaing/astro-paper).
36-
Or you can even give any feedback via my [email](mailto:[email protected]).
25+
This new major was one of the most exited contribution that I have a plasure to be part of, everything started since one of the last companies that I worked uses this bundle and it was stuck on symfony version 4, and I pushed foword the initiative to relase the new major version.
26+
27+
It was a really huge amount of work and it toke aound 4 months the have this released, and I have learned a lot, maybe thing that I never learn in any company.
28+
You can see this long effort in this [issue][sonata_page_bundle_4_issue]
29+
30+
> a special thank you for [Vincent Langlet][vincent_github] and [Jordi Sala Morales][jordi_gthub], for all support that you gave me.
31+
32+
### Rector phpunit
33+
34+
Rector is another php community really friendly, I started to contribute with this project since I was working in a phpunit upgrade, and I faced some code that I need to refactor manually and it was a pain, then I introduce a rule to make this automatic and I've adding more rules to help me with this automatic refactor.
35+
36+
> Thank you ractor for this amazing project, it is a really good example that community works <3
37+
38+
- [Rector][rector_src_prs]
39+
- [Rector Phpunit][rector_phpunit_prs]
40+
41+
### All contributions
42+
43+
- [Myprofile project][myprofile_project]
44+
- [Sonata Page Bundle][sonata_page_bundle_github_prs]
45+
- [Sonata Page Bundle 4 recipe (Symfony flex)][github_prs_sonata_page_bundle_flex]
46+
- [Sonata User Bundle][first_pr_sonata_user]
47+
- [Rector][rector_src_prs]
48+
- [Rector Phpunit][rector_phpunit_prs]
49+
- [LexikJWTAuthenticationBundle][github_prs_jwt_authentication]
50+
51+
[first_pr_sonata_user]: https://github.com/sonata-project/SonataUserBundle/pull/1247
52+
[sonata_page_bundle_4_issue]: https://github.com/sonata-project/SonataPageBundle/issues/1495
53+
[sonata_page_bundle_github_prs]: https://github.com/sonata-project/SonataPageBundle/pulls?q=is%3Apr+author%3Aeerison+is%3Amerged
54+
[vincent_github]: https://github.com/VincentLanglet
55+
[jordi_gthub]: https://github.com/jordisala1991
56+
[github_prs_jwt_authentication]: https://github.com/lexik/LexikJWTAuthenticationBundle/pulls?q=is%3Apr+eerison
57+
[github_prs_sonata_page_bundle_flex]: https://github.com/symfony/recipes-contrib/pull/1440
58+
[rector_phpunit_prs]: https://github.com/rectorphp/rector-phpunit/pulls?q=is%3Apr+author%3Aeerison
59+
[rector_src_prs]: https://github.com/rectorphp/rector-src/pulls?q=is%3Apr+author%3Aeerison+
60+
[myprofile_project]: https://github.com/shield-wall/myprofile

src/pages/index.astro

+6-13
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
2323
<Header />
2424
<main id="main-content">
2525
<section id="hero">
26-
<h1>Mingalaba</h1>
26+
<h1 class="mr-2">Hello hello :)</h1>
2727
<a
2828
target="_blank"
2929
href="/rss.xml"
@@ -40,21 +40,14 @@ const socialCount = SOCIALS.filter(social => social.active).length;
4040
</svg>
4141
<span class="sr-only">RSS Feed</span>
4242
</a>
43-
4443
<p>
45-
AstroPaper is a minimal, responsive, accessible and SEO-friendly Astro
46-
blog theme. This theme follows best practices and provides accessibility
47-
out of the box. Light and dark mode are supported by default. Moreover,
48-
additional color schemes can also be configured.
44+
This page is destinated to share technology content that I have found
45+
during my journey as Software engineer and some interesting points that
46+
I consider relevant. I hope those contents could help somehow.
4947
</p>
5048
<p>
51-
Read the blog posts or check
52-
<LinkButton
53-
className="underline decoration-dashed underline-offset-4 hover:text-skin-accent"
54-
href="https://github.com/satnaing/astro-paper#readme"
55-
>
56-
README
57-
</LinkButton> for more info.
49+
You can find me in one of my contacts bellow, so don't hesitate to ping
50+
me if you want, I will be glad to make new connections.
5851
</p>
5952
{
6053
// only display if at least one social link is enabled

0 commit comments

Comments
 (0)