-
-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (75 loc) · 2.4 KB
/
Copy pathtest-positive.yml
File metadata and controls
84 lines (75 loc) · 2.4 KB
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
name: Test example positive
on:
# # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
# #
# # Added pull_request to register workflow from the PR.
# # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
# pull_request: {}
workflow_dispatch:
inputs:
ref:
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
required: false
type: "string"
sha:
description: "The sha of the commit that triggered the workflow run"
required: false
type: "string"
permissions:
contents: write
id-token: write
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
- id: random
uses: aammirmirza/RandomPasswordGenerator@1.2
with:
length: 15
outputs:
random: ${{ steps.random.outputs.password }}
test:
runs-on: ubuntu-latest
continue-on-error: true
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6.1.1
with:
aws-region: ${{ secrets.TEST_AWS_REGION }}
role-to-assume: ${{ secrets.TEST_IAM_ROLE }}
role-skip-session-tagging: true
- uses: ./
id: current
with:
stack: plat-ue2-sandbox-test-github-action
region: us-east-2
ssm-path: /test-github-action/image
image: nginx
image-tag: ${{ needs.setup.outputs.random }}
webapp-output-name: full_host
organization: ${{ secrets.SPACELIFT_ORGANZATION }}
github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
api_key_id: ${{ secrets.SPACELIFT_API_KEY_ID }}
api_key_secret: ${{ secrets.SPACELIFT_API_KEY_SECRET }}
outputs:
result: ${{ steps.current.outputs.webapp-url }}
assert:
runs-on: ubuntu-latest
needs: [setup, test]
steps:
- uses: nick-fields/assert-action@v1
with:
expected: "https://nginx:${{ needs.setup.outputs.random }}"
actual: "${{ needs.test.outputs.result }}"
teardown:
runs-on: ubuntu-latest
needs: [assert]
if: ${{ always() }}
steps:
- name: Tear down
run: echo "Do Tear down"