Created
June 8, 2024 14:27
-
-
Save shanerbaner82/065d67644deb432ea7b8bba9cde1d0f2 to your computer and use it in GitHub Desktop.
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
--- | |
- hosts: 127.0.0.1 | |
vars: | |
laravel_app_name: my-laravel-app | |
github_repo_name: my-laravel-repo | |
github_username: your-github-username | |
github_password: your-github-password | |
tasks: | |
- name: Install Laravel installer | |
command: composer global require laravel/installer | |
- name: Create a new Laravel app | |
command: laravel new {{ laravel_app_name }} | |
args: | |
chdir: "{{ ansible_env.HOME }}" | |
- name: Create a new Github repository | |
github_repository: | |
name: "{{ github_repo_name }}" | |
description: "A new Laravel app with FilamentPHP" | |
private: no | |
username: "{{ github_username }}" | |
password: "{{ github_password }}" | |
- name: Initialize Git repository | |
command: git init | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Add remote origin | |
command: git remote add origin https://github.com/{{ github_username }}/{{ github_repo_name }}.git | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Stage all files | |
command: git add . | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Commit changes | |
command: git commit -m "Initial commit" | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Push to Github | |
command: git push -u origin master | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Install FilamentPHP package | |
command: composer require filament/filament | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Stage changes after installing FilamentPHP | |
command: git add . | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Commit changes after installing FilamentPHP | |
command: git commit -m "Install FilamentPHP package" | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" | |
- name: Push changes to Github | |
command: git push origin master | |
args: | |
chdir: "{{ ansible_env.HOME }}/{{ laravel_app_name }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment