-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (59 loc) · 2.05 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Deploy to AWS
on:
push:
branches:
- main # Change this to your default branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '22.12' # Specify your Node.js version
- name: Cache Vue.js dependencies
uses: actions/cache@v2
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies for Vue.js
run: |
cd frontend # Change to your Vue.js directory
npm install
- name: Build Vue.js app
run: |
cd frontend
npm run build
- name: Cache Node.js dependencies
uses: actions/cache@v2
with:
path: backend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies for Node.js
run: |
cd platform # Change to your Node.js directory
npm install
- name: Install AWS Elastic Beanstalk CLI
run: |
pip install awsebcli --upgrade --user
echo "${{ runner.tool_cache }}/python/bin" >> $GITHUB_PATH
- name: Deploy to AWS
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-north-1' # Change to your AWS region
run: |
# Deploy your Node.js app (example using Elastic Beanstalk)
cd platform
eb init -p node.js --region $AWS_REGION
eb use Abid-env-1
eb deploy --label github-actions-${{ github.run_id }}
- name: Upload Vue.js build to S3
run: |
aws s3 sync frontend/dist s3://frontendvuelivecollab --delete