<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Riju Pramanik</title>
    <description>The latest articles on DEV Community by Riju Pramanik (@pramanikriju).</description>
    <link>https://dev.to/pramanikriju</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F251953%2F15bc445e-8e82-4914-b09c-ff1f7a02c60c.jpg</url>
      <title>DEV Community: Riju Pramanik</title>
      <link>https://dev.to/pramanikriju</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pramanikriju"/>
    <language>en</language>
    <item>
      <title>How to use Github Actions with Laravel Vapor</title>
      <dc:creator>Riju Pramanik</dc:creator>
      <pubDate>Thu, 06 Jan 2022 12:31:41 +0000</pubDate>
      <link>https://dev.to/pramanikriju/how-to-use-github-actions-with-laravel-vapor-mpc</link>
      <guid>https://dev.to/pramanikriju/how-to-use-github-actions-with-laravel-vapor-mpc</guid>
      <description>&lt;p&gt;Laravel Vapor has been the hot new technology to deploy an infinitely* scalable app powered by AWS Lambda. But with new technology, comes new additional hurdles to deploy your app.&lt;/p&gt;

&lt;p&gt;*Note - Albeit limited by budget and resource limits&lt;/p&gt;

&lt;h4&gt;
  
  
  TLDR: Use this YAML file
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Deploy to production

on:
  push:
    branches: [ master ]

jobs:
  vapor:
    name: Check out, build and deploy using Vapor
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 8.0
        tools: composer:v2
        coverage: none
    - name: Require Vapor CLI
      run: composer global require laravel/vapor-cli
    - name: Deploy Environment
      run: vapor deploy production
      env:
        VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;YAML File to deploy right from your Github Repository&lt;/p&gt;

&lt;p&gt;And ensure VAPOR_API_TOKEN is set in your Github repository secrets. You can generate the token from this link.&lt;/p&gt;

&lt;p&gt;Note - This file does NOT run tests before deploying. Testing-step added in the next section.&lt;br&gt;
Running tests before deploying&lt;/p&gt;

&lt;p&gt;If you are deploying to any production-level server, you probably want to run your tests to get a sanity check on every feature working as intended.&lt;/p&gt;

&lt;p&gt;A couple of things to note while running tests for your Laravel Application in a CI&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You want to avoid SQLite and use MySQL whenever possible. This is because of some edge case migrations which show up as errors, even though they work fine on MySQL&lt;/li&gt;
&lt;li&gt;If you are using PHPUnit instead of Pest (Highly recommended) , change the action named "Run Tests"
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Test and deploy to Vapor
on:
  push:
jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:8.0
        env:
          MYSQL_ROOT_PASSWORD: password
          MYSQL_DATABASE: test
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
    steps:
      - name: Check out code
        uses: actions/checkout@v2
      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ~/.composer/cache/files
          key: dependencies-composer-${{ hashFiles('composer.json') }}
      - name: Set up PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 8.0
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql
      - name: Copy environment config file
        run: php -r "file_exists('.env') || copy('.env.ci', '.env');"
      - name: Validate Composer
        run: composer validate
      - name: Install Composer dependencies
        run: composer install --prefer-dist --no-interaction --no-suggest
      - name: Generate key
        run: php artisan key:generate
      - name: Directory Permissions
        run: chmod -R 777 storage bootstrap/cache
      - name: Run DB migrations
        run : php artisan migrate
      - name: Run Tests
        run: ./vendor/bin/pest
        env:
          APP_ENV: testing
          DB_CONNECTION: mysql
          DB_DATABASE: test
          DB_HOST: 127.0.0.1
          DB_PORT: 3306
          DB_USERNAME: root
          DB_PASSWORD: password
      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: Logs
          path: ./storage/logs
  deploy:
    name: Deploy to Vapor
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
    needs:
      - test
    steps:
      - name: Check out code
        uses: actions/checkout@v2
      - name: Validate Composer
        run: composer validate
      - name: Install Composer dependencies
        run: composer install --prefer-dist --no-interaction --no-suggest --no-dev
      - name: Deploy code
        run: ./vendor/bin/vapor deploy ${{ env.APP_ENV }} --commit="${{ github.sha }}"
        env:
          APP_ENV: ${{ github.ref == 'refs/heads/master' &amp;amp;&amp;amp; 'production' || 'staging' }}
          VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: Logs
          path: ./storage/logs

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Entire CI file for running tests before deploying&lt;/p&gt;

&lt;p&gt;A few salient features of this CI file are - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It runs tests before deploying&lt;/li&gt;
&lt;li&gt;If tests fail, the artefacts/logs are available immediately as downloadable zip files&lt;/li&gt;
&lt;li&gt;Develop branch deploys to staging, Master/Main branch deploys to production automatically. Single file across both the branches.&lt;/li&gt;
&lt;li&gt;Github allows granular control over each step, and this remains highly customizable as per your needs &lt;/li&gt;
&lt;li&gt;Every step is broken down into clean modular sections, with verbose logging if any step fails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Builds take around 3-5 minutes but depend a lot on the number and size of your tests. This will greatly reduce if you use the multithreaded option for PHPUnit, but that's an optimization I can leave for you.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>github</category>
    </item>
    <item>
      <title>The how, why, and when of a tech blog</title>
      <dc:creator>Riju Pramanik</dc:creator>
      <pubDate>Tue, 22 Dec 2020 14:37:00 +0000</pubDate>
      <link>https://dev.to/pramanikriju/the-how-why-and-when-of-a-tech-blog-4oca</link>
      <guid>https://dev.to/pramanikriju/the-how-why-and-when-of-a-tech-blog-4oca</guid>
      <description>&lt;p&gt;This post was originally made on - &lt;a href="https://tech.riju.co/posts/how-when-why"&gt;My Tech Blog&lt;/a&gt;&lt;br&gt;
Most developers handle a wide variety of challenging tasks on a day to day basis, and that includes the meticulous art of being able to &lt;em&gt;google&lt;/em&gt; our bugs and find relevant solutions. &lt;br&gt;
And you have to admit, you have copy-pasted code from a technical blog at some point in time. After all, we do stand on the shoulders of giants.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TODO - Insert flat earth turtle picture&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why &lt;em&gt;another&lt;/em&gt; tech blog
&lt;/h2&gt;

&lt;p&gt;To put it simply, nothing demonstrates your skill better than being able to impart that skill onto others. As a developer, its an easy way to showcase your abilities on a range of topics to any potential employer. This is especially beneficial because a blog can portray your thinking process and problem-solving abilities in broader ways than a white board interview can for such &lt;em&gt;untangible&lt;/em&gt; skills. &lt;/p&gt;

&lt;h2&gt;
  
  
  How to make a distinct tech blog
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Identify and cater to your audience&lt;/strong&gt;
Your audience &lt;strong&gt;isn't&lt;/strong&gt; going to be your average leisure reading crowd. It probably is a developer on their second cup of coffee desperately trying to fix something with at least 30 other tabs open simultaneously. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make an impression&lt;/strong&gt;
Clean UI, readable text, lack of &lt;em&gt;snazzy&lt;/em&gt; animations. To the point information. All of it matters. You should put in the time and effort to save someone else the same time and effort. 
This matters even more when an employer goes through your blog, and a well designed and maintained one can make your resume shine!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Try not to use WordPress&lt;/strong&gt;
You probably can, and it's easier, but as a showcase of your technical skills, you can do better. Take this blog, for example, I learned &lt;strong&gt;Next.js&lt;/strong&gt; (detailed post coming &lt;em&gt;soon&lt;/em&gt; 😉), followed a tutorial and now I can use this blog on my portfolio as well. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't repeat yourself (or others)&lt;/strong&gt;
There are &lt;em&gt;plenty&lt;/em&gt; of technical blogs and stack overflow posts out there. Not everything is worth repeating. Only repeat something already out there if :

&lt;ol&gt;
&lt;li&gt;A given resource was &lt;em&gt;hard&lt;/em&gt; to find. &lt;/li&gt;
&lt;li&gt;It needs updating.&lt;/li&gt;
&lt;li&gt;Alternative approaches to established practices. 
## When to blog
Honestly, whenever you want to, or have the time to. It might be a god tip to create a blog post whenever you solve a tricky problem or a persistent headache is resolved. For me, that happens at least once a week, so my goal is to do that as my New Year's resolution (fingers crossed 🤞).&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay tuned for further updates, and I'll see you in 2021!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
