-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (61 loc) · 1.61 KB
/
github-action-nginx.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
77
78
79
80
name: Setup-Nginx
on:
pull_request:
types:
- opened
# - closed
# branches:
branches:
# - feature1
# - main
# tags:
# - v1
jobs:
build:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build Docker Image
run: echo "Build successful"
test:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Run Basic Tests
run: echo "Tests successful!"
deploy:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: [build,test]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Deploy to ECR
run: echo "Deploy to ECR"
setup-nginx:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: [build,test,deploy]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: print name
run: echo "My USER_NAME is ${{env.USER_NAME}}. USER_PASSWORD is ${{env.USER_PASSWORD}}"
- name: Create and Navigate to Directory
run: |
mkdir github-action-nginx
cd github-action-nginx
touch code.html
- name: Update and Upgrade
run: sudo apt-get update && sudo apt-get upgrade -y
- name: Install Nginx
run: sudo apt-get install nginx -y
- name: Start Nginx
run: sudo service nginx start
- name: staus nginx
run: sudo systemctl status nginx