-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (68 loc) · 1.83 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
81
82
83
84
85
name: Setup Nginx
on:
push:
# types:
# - closed
branches:
- master
# tags:
# - v1
jobs:
build:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.build.outputs.result }}
steps:
# - name: Checkout Repository
# uses: actions/checkout@v2
# - name: Build Docker Image
- id: build
run: echo "result=Build successful" >> "$GITHUB_OUTPUT"
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 ${{ needs.build.outputs.output1 }}
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
environment:
name: Development
needs: [build,test,deploy]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: print Secrets
env:
USER_NAME: ${{ env.USER_NAME }}
USER_PASSWORD: ${{ secrets.USER_PASSWORD }}
run: |
echo "USER_NAME: $USER_NAME"
echo "USER_PASSWORD: $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