Skip to content

Commit

Permalink
add pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Feb 22, 2024
1 parent 5a8091d commit 0879185
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy OCI to EC2

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Rename .next to .next2
run: mv .next .next2

- name: Send .next2 to EC2
uses: appleboy/scp-action@master
with:
host: ${{ secrets.EC2_HOST_OCI }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY_OCI }}
source: .next2
target: oci-assam-frontend
- name: Update with new Build
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST_OCI }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY_OCI }}
script: rm -rf oci-assam-frontend/.next; mv oci-assam-frontend/.next2 oci-assam-frontend/.next; pm2 restart oci-assam-frontend
1 change: 1 addition & 0 deletions pages/sitemap.xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const getServerSideProps = async function ({ res }) {
'_app.tsx',
'_document.tsx',
'_error.tsx',
'sitemap_index.xml.js',
'sitemap.xml.js',
'index.tsx',
'[state]',
Expand Down

0 comments on commit 0879185

Please sign in to comment.