dev-resources.site
for different kinds of informations.
Auto Deploy Laravel with Deployer.yml sample With Github Runner
Published at
12/4/2024
Categories
laravel
github
cicd
githubactions
Author
kevinmel2000
Author
12 person written this
kevinmel2000
open
create a File Deployer.yml sample for github workflow
# This is a basic workflow that is manually triggered
name: Manual workflow
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
push:
branches:
- main
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
CodeCheckout:
# The type of runner that the job will run on
runs-on: self-hosted
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
CodeCheckout2:
# The type of runner that the job will run on
runs-on: self-hosted
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
PullProject:
needs: CodeCheckout
runs-on: self-hosted
steps:
- name: Run project
run: |
cd /var/www/html/api_mobile/
git -c credential.helper='!f() { echo "username=git username"; echo "password= git password(token pass)"; }; f' pull origin main
# Runs a single command using the runners shell
- name: Build assets
run: npm install && npm run build
- name: Install PHP dependencies
run: composer install --no-dev --optimize-autoloader
- name: Clear cache
run: php artisan clear-compiled
- name: Recreate cache
run: php artisan optimize
Download
Create a folder
$ mkdir actions-runner && cd actions-runner
Download the latest runner package
$ curl -o actions-runner-linux-x64-2.320.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.320.0/actions-runner-linux-x64-2.320.0.tar.gz
Optional: Validate the hash
$ echo "93ac1b7ce743ee85b5d386f5c1787385ef07b3d7c728ff66ce0d3813d actions-runner-linux-x64-2.320.0.tar.gz" | shasum -a 256 -c
Extract the installer
$ tar xzf ./actions-runner-linux-x64-2.320.0.tar.gz
Configure
Create the runner and start the configuration experience:
export RUNNER_ALLOW_RUNASROOT="1"
RUNNER_ALLOW_RUNASROOT="1" ./config.sh --url https://github.com/repo --token BLLCPCGOV5JBDIDVTN45333HFM
Last step, run it!:
RUNNER_ALLOW_RUNASROOT="1" ./run.sh &
githubactions Article's
30 articles in total
Git Commands Every Developer Must Know 🔥
read article
Github Actions with Vercel in 2024
read article
Undo Mistakes in Git: Revert, Reset, and Checkout Simplified
read article
Taming the CI Beast: Optimizing a Massive Next.js Application (Part 1)
read article
Visualize TypeScript Dependencies of Changed Files in a Pull Request Using dependency-cruiser-report-action
read article
From Code to Cloud: Builds Next.js on GitHub Actions, straight to production
read article
Publishing JSR package with Github Actions that react-hook-use-cta used
read article
Zero Config Spring Batch: Just Write Business Logic
read article
When GitHub Actions Build Fails Due to pnpm-lockfile
read article
CI/CD Tools for Startups: Empowering IT Professionals to Scale Smarter
read article
Securely access Amazon EKS with GitHub Actions and OpenID Connect
read article
Publishing NPM package with Github Actions that react-hook-use-cta used
read article
[Boost]
read article
Building and Deploying a New API (Part 2)
read article
From days to minutes: Build and publish React Native apps using Fastlane and Github Actions
read article
Private LLMs for GitHub Actions
read article
Desplegar a Firebase con GitHub actions
read article
How to build a chatbot powered by github actions
read article
Building an educational game with AI tools and Azure Static Web Apps (Part 2)
read article
Continous Integration And Continous Deployment Of A Full-Stack Docker-Compose Application
read article
Git Hub Pages is a free and awesome solution for your profile or personal site
read article
Build vs. Buy: Choosing the Right Approach to IaC Management
read article
How to release a version of a web app using GitHub Workflow with GitHub Actions
read article
CI/CD com GitHub Actions e teste local com Act
read article
Deploying Containerized Applications to AWS ECS Using Terraform and CI/CD (Project Summary)
read article
Automating Unity Builds with GitHub Actions
read article
Auto Deploy Laravel with Deployer.yml sample With Github Runner
currently reading
Create an auto-merging workflow on Github
read article
github actions
read article
VS Code + LLM = ?
read article
Featured ones: