@@ -6,106 +6,106 @@ name: linux_benchmark_pipeline
6
6
# Triggers the workflow on push or pull request
7
7
# events but only for the devel branch
8
8
on :
9
- pull_request_target :
10
- types : [opened, reopened, synchronize]
11
- branches :
12
- - devel
13
- - main
14
- paths :
15
- - ' **.yml'
16
- - ' **.sh'
17
- - ' **.j2'
18
- - ' **.ps1'
19
- - ' **.cfg'
9
+ pull_request_target :
10
+ types : [opened, reopened, synchronize]
11
+ branches :
12
+ - devel
13
+ - main
14
+ paths :
15
+ - ' **.yml'
16
+ - ' **.sh'
17
+ - ' **.j2'
18
+ - ' **.ps1'
19
+ - ' **.cfg'
20
20
21
21
# A workflow run is made up of one or more jobs
22
22
# that can run sequentially or in parallel
23
23
jobs :
24
24
# This will create messages for first time contributers and direct them to the Discord server
25
- welcome :
26
- runs-on : ubuntu-latest
27
-
28
- steps :
29
- - uses : actions/first-interaction@main
30
- with :
31
- repo-token : ${{ secrets.GITHUB_TOKEN }}
32
- pr-message : |-
33
- Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown!
34
- Please join in the conversation happening on the [Discord Server](https://discord.io/ansible-lockdown) as well.
35
- # This workflow contains a single job called "build"
36
- build :
37
- # The type of runner that the job will run on
38
- runs-on : ubuntu-latest
39
-
40
- env :
41
- ENABLE_DEBUG : false
42
-
43
- # Steps represent a sequence of tasks that will be executed as part of the job
44
- steps :
45
- # Checks-out your repository under $GITHUB_WORKSPACE,
46
- # so your job can access it
47
- - uses : actions/checkout@v3
48
- with :
49
- ref : ${{ github.event.pull_request.head.sha }}
50
-
51
- - name : Add_ssh_key
52
- working-directory : .github/workflows
53
- env :
54
- SSH_AUTH_SOCK : /tmp/ssh_agent.sock
55
- PRIVATE_KEY : " ${{ secrets.SSH_PRV_KEY }}"
56
- run : |
57
- mkdir .ssh
58
- chmod 700 .ssh
59
- echo $PRIVATE_KEY > .ssh/github_actions.pem
60
- chmod 600 .ssh/github_actions.pem
61
-
62
- # ## Build out the server
63
- - name : Terraform_Init
64
- working-directory : .github/workflows
65
- run : terraform init
66
-
67
- - name : Terraform_Validate
68
- working-directory : .github/workflows
69
- run : terraform validate
25
+ welcome :
26
+ runs-on : ubuntu-latest
27
+
28
+ steps :
29
+ - uses : actions/first-interaction@main
30
+ with :
31
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
32
+ pr-message : |-
33
+ Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown!
34
+ Please join in the conversation happening on the [Discord Server](https://discord.io/ansible-lockdown) as well.
35
+ # This workflow contains a single job called "build"
36
+ build :
37
+ # The type of runner that the job will run on
38
+ runs-on : ubuntu-latest
70
39
71
- - name : Terraform_Apply
72
- working-directory : .github/workflows
73
40
env :
74
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
75
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
76
- run : terraform apply -var-file "github_vars.tfvars" -var-file "OS.tfvars" --auto-approve -input=false
77
-
78
- # # Debug Section
79
- - name : DEBUG - Show Ansible hostfile
80
- if : env.ENABLE_DEBUG == 'true'
81
- working-directory : .github/workflows
82
- run : cat hosts.yml
83
-
84
- # Aws deployments taking a while to come up insert sleep or playbook fails
85
-
86
- - name : Sleep for 60 seconds
87
- run : sleep 60s
88
- shell : bash
89
-
90
- # Run the ansible playbook
91
- - name : Run_Ansible_Playbook
92
- uses : arillso/action.playbook@master
93
- with :
94
- playbook : site.yml
95
- inventory : .github/workflows/hosts.yml
96
- galaxy_file : collections/requirements.yml
97
- private_key : ${{ secrets.SSH_PRV_KEY }}
98
- # verbose: 3
99
- env :
100
- ANSIBLE_HOST_KEY_CHECKING : " false"
101
- ANSIBLE_DEPRECATION_WARNINGS : " false"
102
-
103
- # Remove test system - User secrets to keep if necessary
41
+ ENABLE_DEBUG : false
42
+
43
+ # Steps represent a sequence of tasks that will be executed as part of the job
44
+ steps :
45
+ # Checks-out your repository under $GITHUB_WORKSPACE,
46
+ # so your job can access it
47
+ - uses : actions/checkout@v3
48
+ with :
49
+ ref : ${{ github.event.pull_request.head.sha }}
50
+
51
+ - name : Add_ssh_key
52
+ working-directory : .github/workflows
53
+ env :
54
+ SSH_AUTH_SOCK : /tmp/ssh_agent.sock
55
+ PRIVATE_KEY : " ${{ secrets.SSH_PRV_KEY }}"
56
+ run : |
57
+ mkdir .ssh
58
+ chmod 700 .ssh
59
+ echo $PRIVATE_KEY > .ssh/github_actions.pem
60
+ chmod 600 .ssh/github_actions.pem
104
61
105
- - name : Terraform_Destroy
106
- working-directory : .github/workflows
107
- if : always() && env.ENABLE_DEBUG == 'false'
108
- env :
109
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
110
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
111
- run : terraform destroy -var-file "github_vars.tfvars" -var-file "OS.tfvars" --auto-approve -input=false
62
+ # ## Build out the server
63
+ - name : Terraform_Init
64
+ working-directory : .github/workflows
65
+ run : terraform init
66
+
67
+ - name : Terraform_Validate
68
+ working-directory : .github/workflows
69
+ run : terraform validate
70
+
71
+ - name : Terraform_Apply
72
+ working-directory : .github/workflows
73
+ env :
74
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
75
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
76
+ run : terraform apply -var-file "github_vars.tfvars" -var-file "OS.tfvars" --auto-approve -input=false
77
+
78
+ # # Debug Section
79
+ - name : DEBUG - Show Ansible hostfile
80
+ if : env.ENABLE_DEBUG == 'true'
81
+ working-directory : .github/workflows
82
+ run : cat hosts.yml
83
+
84
+ # Aws deployments taking a while to come up insert sleep or playbook fails
85
+
86
+ - name : Sleep for 60 seconds
87
+ run : sleep 60s
88
+ shell : bash
89
+
90
+ # Run the ansible playbook
91
+ - name : Run_Ansible_Playbook
92
+ uses : arillso/action.playbook@master
93
+ with :
94
+ playbook : site.yml
95
+ inventory : .github/workflows/hosts.yml
96
+ galaxy_file : collections/requirements.yml
97
+ private_key : ${{ secrets.SSH_PRV_KEY }}
98
+ # verbose: 3
99
+ env :
100
+ ANSIBLE_HOST_KEY_CHECKING : " false"
101
+ ANSIBLE_DEPRECATION_WARNINGS : " false"
102
+
103
+ # Remove test system - User secrets to keep if necessary
104
+
105
+ - name : Terraform_Destroy
106
+ working-directory : .github/workflows
107
+ if : always() && env.ENABLE_DEBUG == 'false'
108
+ env :
109
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
110
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
111
+ run : terraform destroy -var-file "github_vars.tfvars" -var-file "OS.tfvars" --auto-approve -input=false
0 commit comments