Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 30, 2022 09:54 am GMT

CI/CD pipelines with AWS Amplify

The company I work for is an AWS partner and it is natural that many of the applications we build are based on the services offered by Amazon.

We're migrating our CI/CD pipelines to AWS Amplify and I wanted to show you how we can achieve great results with just a few clicks.

The example is based on a Next.js application hosted on GitHub.

GitHub

To initialize the application we can use the command:
npx create-next-app@latest --typescript

Once the starter is created, we edit the file
pages/index.tsx
replacing the boilerplate with this code:

pages index

An environment variable is used here. We have to configure it in the Next.js configuration file
next.config.js

const nextConfig = {  [...]  env: { PROJECT_NAME: process.env.PROJECT_NAME, },}module.exports = nextConfig

We can test the app locally by creating a .env.local file to set the environment variable

EnvLocal

After we sync the project with remote GitHub, we're ready to move on to the deployment part.

AWS Amplify

Once logged into the AWS console, let's search for the Amplify service.

AWSDash

Configuration

Click on Host web app

HostWebApp

here we can connect our GitHub account and select the project we just created

GitHubSelection

GitHubRepo

Click on Next, here we can configure the build and we can set our environment variable

Build

Save

Build & Deploy

The build and the deployment will be performed automatically

Deploy

Final result

FinalResult

This is the first article on AWS Amplify, if you find the topic interesting give and I will write more about it. Bye

You canfollow me on Twitter, where I'm posting or retweeting interesting articles.


Original Link: https://dev.to/this-is-learning/cicd-pipelines-with-aws-amplify-5a1b

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To