Logo

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
Categories
4 categories in total
laravel
open
github
open
cicd
open
githubactions
open
Author
12 person written this
kevinmel2000
open
Auto Deploy Laravel with Deployer.yml sample With Github Runner

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

Enter fullscreen mode Exit fullscreen mode

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
Favicon
Git Commands Every Developer Must Know 🔥
Favicon
Github Actions with Vercel in 2024
Favicon
Undo Mistakes in Git: Revert, Reset, and Checkout Simplified
Favicon
Taming the CI Beast: Optimizing a Massive Next.js Application (Part 1)
Favicon
Visualize TypeScript Dependencies of Changed Files in a Pull Request Using dependency-cruiser-report-action
Favicon
From Code to Cloud: Builds Next.js on GitHub Actions, straight to production
Favicon
Publishing JSR package with Github Actions that react-hook-use-cta used
Favicon
Zero Config Spring Batch: Just Write Business Logic
Favicon
When GitHub Actions Build Fails Due to pnpm-lockfile
Favicon
CI/CD Tools for Startups: Empowering IT Professionals to Scale Smarter
Favicon
Securely access Amazon EKS with GitHub Actions and OpenID Connect
Favicon
Publishing NPM package with Github Actions that react-hook-use-cta used
Favicon
[Boost]
Favicon
Building and Deploying a New API (Part 2)
Favicon
From days to minutes: Build and publish React Native apps using Fastlane and Github Actions
Favicon
Private LLMs for GitHub Actions
Favicon
Desplegar a Firebase con GitHub actions
Favicon
How to build a chatbot powered by github actions
Favicon
Building an educational game with AI tools and Azure Static Web Apps (Part 2)
Favicon
Continous Integration And Continous Deployment Of A Full-Stack Docker-Compose Application
Favicon
Git Hub Pages is a free and awesome solution for your profile or personal site
Favicon
Build vs. Buy: Choosing the Right Approach to IaC Management
Favicon
How to release a version of a web app using GitHub Workflow with GitHub Actions
Favicon
CI/CD com GitHub Actions e teste local com Act
Favicon
Deploying Containerized Applications to AWS ECS Using Terraform and CI/CD (Project Summary)
Favicon
Automating Unity Builds with GitHub Actions
Favicon
Auto Deploy Laravel with Deployer.yml sample With Github Runner
Favicon
Create an auto-merging workflow on Github
Favicon
github actions
Favicon
VS Code + LLM = ?

Featured ones: