The first GitHub Actions
๐ช๐๐๐๐ ๐๐๐ ๐ซ๐๐๐ถ๐๐ ๐ป๐๐๐ ๐ช๐๐๐๐๐๐๐๐ || ๐ท๐๐๐ซ๐๐๐ถ๐๐๐ฎ๐๐ ๐ค https://t.me/prodevopsguy ๐ Hi there! We are ProDevOpsGuy, a passionate DevOps enthusiast Tech Community with a strong belief in the power of automation and collaboration to drive innovation. ๐ I thrive in bridging the gap between development and operations, creating seamless and efficient software delivery pipelines. My journey in the world of DevOps has allowed me to blend my technical skills with a knack for problem-solving, enabling me to contribute effectively to agile and dynamic environments. ๐ก With a keen interest in continuous integration, continuous delivery (CI/CD), containerization, and orchestration, I've had the privilege to explore cutting-edge technologies like Docker, Kubernetes, Jenkins, and Ansible. I find joy in designing scalable and resilient infrastructures that enable teams to deploy applications faster and with greater confidence. ๐ Beyond the tech realm, I'm an advocate for DevOps culture, emphasizing collaboration, communication, and a relentless pursuit of improvement. I'm always eager to connect with fellow professionals, exchange insights, and explore opportunities to collaborate on exciting projects. ๐ When I'm not tinkering with the latest DevOps tools, you can find me indulging in books on technology trends, hiking to rejuvenate, and occasionally experimenting with new coding challenges. ๐ Let's connect! Whether you're looking to discuss DevOps methodologies, explore partnership opportunities, or simply share experiences, feel free to reach out. I'm excited to be part of the DevOps journey, driving excellence together.
1. Introduction
GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.
To get more details about GitHub Actions you can see About GitHub Actions
2. Let's start
Make sure that you register Github Actions beta program and also receive an approval email from Github like "Youโre in! Get started with GitHub Actions beta"...
In this tutorial, I use my repository called React Starter Kit.
Don't talk any more, go go go...
Step 1: Go to your repository and click on the "Actions" tab
Step 2: Click the button "Set up a workflow yourself"
You will see the template below:
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
Step 3: Edit the template
Following the Workflow syntax for GitHub Actions
and Set up your GitHub Actions workflow with a specific version of node.js
I edit my first actions like below:
name: CI
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-18.04
strategy:
matrix:
node_version: [10, 12]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
version: ${{ matrix.node_version }}
- name: yarn install, yarn lint, yarn test, yarn build
run: |
yarn install
yarn lint
yarn test
yarn build
Explanation:
In the configuration above
GitHub Actions will trigger on
pushevent on any branchIt will use Ubuntu 18.04
runs-on: ubuntu-18.04It will run 2 times on 2 node versions:
node_version: [10, 12]It will use
yarnto run instead ofnpmIt will run
yarn install,yarn lint,yarn test,yarn build
For further commands please refer to the Workflow syntax for GitHub Actions
Step 4: Waiting and getting the result!
It works fine!!!
3. In conclusion
So easy to create a simple pipeline with GitHub Actions. It will help you build your project without using any external CI/CD like Circle CI or something like that.
If you find this article helpful then you can buy me a coffee.
Follow for more stories like this ๐/ GitHub.






