Skip to content

Commit 3be8d9c

Browse files
authored
feat: Autodeploy Option (#27)
* Add autodeploy option for automatic stack deployment * make readme * Update default value of autodeploy to be a string
1 parent e3cd343 commit 3be8d9c

File tree

3 files changed

+50
-166
lines changed

3 files changed

+50
-166
lines changed

README.md

Lines changed: 38 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11

2-
<!-- markdownlint-disable -->
3-
# github-action-spacelift-stack-deploy
42

5-
[![Latest Release](https://img.shields.io/github/release/cloudposse/github-action-spacelift-stack-deploy.svg)](https://github.com/cloudposse/github-action-spacelift-stack-deploy/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
3+
<!-- markdownlint-disable -->
4+
# github-action-spacelift-stack-deploy <a href="https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content="><img align="right" src="https://cloudposse.com/logo-300x69.svg" width="150" /></a>
5+
<a href="https://github.com/cloudposse/github-action-spacelift-stack-deploy/releases/latest"><img src="https://img.shields.io/github/release/cloudposse/github-action-spacelift-stack-deploy.svg" alt="Latest Release"/></a><a href="https://slack.cloudposse.com"><img src="https://slack.cloudposse.com/badge.svg" alt="Slack Community"/></a>
66
<!-- markdownlint-restore -->
77

8-
[![README Header][readme_header_img]][readme_header_link]
9-
10-
[![Cloud Posse][logo]](https://cpco.io/homepage)
11-
128
<!--
139
1410
1511
1612
1713
** DO NOT EDIT THIS FILE
1814
**
19-
** This file was automatically generated by the `build-harness`.
15+
** This file was automatically generated by the `cloudposse/build-harness`.
2016
** 1) Make all changes to `README.yaml`
2117
** 2) Run `make init` (you only need to do this once)
2218
** 3) Run`make readme` to rebuild this file.
@@ -32,29 +28,6 @@
3228

3329
Trigger Spacelist stack synchronously
3430

35-
---
36-
37-
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
38-
[<img align="right" title="Share via Email" src="https://docs.cloudposse.com/images/ionicons/ios-email-outline-2.0.1-16x16-999999.svg"/>][share_email]
39-
[<img align="right" title="Share on Google+" src="https://docs.cloudposse.com/images/ionicons/social-googleplus-outline-2.0.1-16x16-999999.svg" />][share_googleplus]
40-
[<img align="right" title="Share on Facebook" src="https://docs.cloudposse.com/images/ionicons/social-facebook-outline-2.0.1-16x16-999999.svg" />][share_facebook]
41-
[<img align="right" title="Share on Reddit" src="https://docs.cloudposse.com/images/ionicons/social-reddit-outline-2.0.1-16x16-999999.svg" />][share_reddit]
42-
[<img align="right" title="Share on LinkedIn" src="https://docs.cloudposse.com/images/ionicons/social-linkedin-outline-2.0.1-16x16-999999.svg" />][share_linkedin]
43-
[<img align="right" title="Share on Twitter" src="https://docs.cloudposse.com/images/ionicons/social-twitter-outline-2.0.1-16x16-999999.svg" />][share_twitter]
44-
45-
46-
47-
48-
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
49-
50-
51-
52-
53-
54-
55-
56-
57-
5831

5932

6033

@@ -67,11 +40,8 @@ The GitHub action triggers Spacelift stack run to provistion infrastructure.
6740

6841

6942

70-
7143
## Usage
7244

73-
74-
7545
```yaml
7646
name: Pull Request
7747
on:
@@ -109,6 +79,7 @@ The GitHub action triggers Spacelift stack run to provistion infrastructure.
10979
|------|-------------|---------|----------|
11080
| api\_key\_id | API Key ID | N/A | true |
11181
| api\_key\_secret | API Key Secret | N/A | true |
82+
| autodeploy | If true, automatically deploy the stack without manual confirmation | false | false |
11283
| github\_token | GitHub Token (Required to install Spacelift CLI) | N/A | true |
11384
| organization | Organization name | N/A | true |
11485
| stack | Stack name | N/A | true |
@@ -122,15 +93,6 @@ The GitHub action triggers Spacelift stack run to provistion infrastructure.
12293
<!-- markdownlint-restore -->
12394
12495
125-
126-
## Share the Love
127-
128-
Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/github-action-spacelift-stack-deploy)! (it helps us **a lot**)
129-
130-
Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)
131-
132-
133-
13496
## Related Projects
13597
13698
Check out these related projects.
@@ -146,86 +108,55 @@ For additional context, refer to some of these links.
146108
- [example-github-action-release-workflow](https://github.com/cloudposse/example-github-action-release-workflow) - Example application with complicated release workflow
147109
148110
149-
## Help
150-
151-
**Got a question?** We got answers.
152-
153-
File a GitHub [issue](https://github.com/cloudposse/github-action-spacelift-stack-deploy/issues), send us an [email][email] or join our [Slack Community][slack].
154-
155-
[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
156-
157-
## DevOps Accelerator for Startups
158-
159111
160-
We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us.
161112
162-
[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support]
113+
## ✨ Contributing
163114
164-
Work directly with our team of DevOps experts via email, slack, and video conferencing.
115+
This project is under active development, and we encourage contributions from our community.
165116
166-
We deliver 10x the value for a fraction of the cost of a full-time engineer. Our track record is not even funny. If you want things done right and you need it done FAST, then we're your best bet.
167117
168-
- **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.
169-
- **Release Engineering.** You'll have end-to-end CI/CD with unlimited staging environments.
170-
- **Site Reliability Engineering.** You'll have total visibility into your apps and microservices.
171-
- **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes.
172-
- **GitOps.** You'll be able to operate your infrastructure via Pull Requests.
173-
- **Training.** You'll receive hands-on training so your team can operate what we build.
174-
- **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel.
175-
- **Troubleshooting.** You'll get help to triage when things aren't working.
176-
- **Code Reviews.** You'll receive constructive feedback on Pull Requests.
177-
- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects.
178118
179-
## Slack Community
119+
Many thanks to our outstanding contributors:
180120
181-
Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
121+
<a href="https://github.com/cloudposse/github-action-spacelift-stack-deploy/graphs/contributors">
122+
<img src="https://contrib.rocks/image?repo=cloudposse/github-action-spacelift-stack-deploy&max=24" />
123+
</a>
182124
183-
## Discourse Forums
184-
185-
Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.
186-
187-
## Newsletter
188-
189-
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
190-
191-
## Office Hours
192-
193-
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
194-
195-
[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours]
196-
197-
## Contributing
198-
199-
### Bug Reports & Feature Requests
200-
201-
Please use the [issue tracker](https://github.com/cloudposse/github-action-spacelift-stack-deploy/issues) to report any bugs or file feature requests.
202-
203-
### Developing
204-
205-
If you are interested in being a contributor and want to get involved in developing this project or [help out](https://cpco.io/help-out) with our other projects, we would love to hear from you! Shoot us an [email][email].
125+
For 🐛 bug reports & feature requests, please use the [issue tracker](https://github.com/cloudposse/github-action-spacelift-stack-deploy/issues).
206126
207127
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
208-
209-
1. **Fork** the repo on GitHub
210-
2. **Clone** the project to your own machine
211-
3. **Commit** changes to your own branch
212-
4. **Push** your work back up to your fork
213-
5. Submit a **Pull Request** so that we can review your changes
128+
1. Review our [Code of Conduct](https://github.com/cloudposse/github-action-spacelift-stack-deploy/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md).
129+
2. **Fork** the repo on GitHub
130+
3. **Clone** the project to your own machine
131+
4. **Commit** changes to your own branch
132+
5. **Push** your work back up to your fork
133+
6. Submit a **Pull Request** so that we can review your changes
214134
215135
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
216136
137+
### 🌎 Slack Community
217138
218-
## Copyright
139+
Join our [Open Source Community](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=slack) on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
219140
220-
Copyright © 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright)
141+
### 📰 Newsletter
221142
143+
Sign up for [our newsletter](https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=newsletter) and join 3,000+ DevOps engineers, CTOs, and founders who get insider access to the latest DevOps trends, so you can always stay in the know.
144+
Dropped straight into your Inbox every week — and usually a 5-minute read.
222145
146+
### 📆 Office Hours <a href="https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=office_hours"><img src="https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png" align="right" /></a>
223147
148+
[Join us every Wednesday via Zoom](https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=office_hours) for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a _live Q&A_ that you can’t find anywhere else.
149+
It's **FREE** for everyone!
224150
## License
225151
226-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
152+
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="License"></a>
153+
154+
<details>
155+
<summary>Preamble to the Apache License, Version 2.0</summary>
156+
<br/>
157+
<br/>
227158
228-
See [LICENSE](LICENSE) for full details.
159+
Complete license is available in the [`LICENSE`](LICENSE) file.
229160

230161
```text
231162
Licensed to the Apache Software Foundation (ASF) under one
@@ -245,74 +176,17 @@ KIND, either express or implied. See the License for the
245176
specific language governing permissions and limitations
246177
under the License.
247178
```
248-
249-
250-
251-
252-
253-
254-
255-
179+
</details>
256180

257181
## Trademarks
258182

259183
All other trademarks referenced herein are the property of their respective owners.
260184

261-
## About
262-
263-
This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know by [leaving a testimonial][testimonial]!
264-
265-
[![Cloud Posse][logo]][website]
266-
267-
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❤️ [Open Source Software][we_love_open_source].
268-
269-
We offer [paid support][commercial_support] on all of our projects.
270185

271-
Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.
272-
273-
274-
275-
### Contributors
186+
---
187+
Copyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright)
276188

277-
<!-- markdownlint-disable -->
278-
| [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] |
279-
|---|
280-
<!-- markdownlint-restore -->
281189

282-
[goruha_homepage]: https://github.com/goruha
283-
[goruha_avatar]: https://img.cloudposse.com/150x150/https://github.com/goruha.png
190+
<a href="https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=readme_footer_link"><img alt="README footer" src="https://cloudposse.com/readme/footer/img"/></a>
284191

285-
[![README Footer][readme_footer_img]][readme_footer_link]
286-
[![Beacon][beacon]][website]
287-
<!-- markdownlint-disable -->
288-
[logo]: https://cloudposse.com/logo-300x69.svg
289-
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=docs
290-
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=website
291-
[github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=github
292-
[jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=jobs
293-
[hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=hire
294-
[slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=slack
295-
[linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=linkedin
296-
[twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=twitter
297-
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=testimonial
298-
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=office_hours
299-
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=newsletter
300-
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=discourse
301-
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=email
302-
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=commercial_support
303-
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=we_love_open_source
304-
[terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=terraform_modules
305-
[readme_header_img]: https://cloudposse.com/readme/header/img
306-
[readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=readme_header_link
307-
[readme_footer_img]: https://cloudposse.com/readme/footer/img
308-
[readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=readme_footer_link
309-
[readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img
310-
[readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-spacelift-stack-deploy&utm_content=readme_commercial_support_link
311-
[share_twitter]: https://twitter.com/intent/tweet/?text=github-action-spacelift-stack-deploy&url=https://github.com/cloudposse/github-action-spacelift-stack-deploy
312-
[share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=github-action-spacelift-stack-deploy&url=https://github.com/cloudposse/github-action-spacelift-stack-deploy
313-
[share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/github-action-spacelift-stack-deploy
314-
[share_facebook]: https://facebook.com/sharer/sharer.php?u=https://github.com/cloudposse/github-action-spacelift-stack-deploy
315-
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/github-action-spacelift-stack-deploy
316-
[share_email]: mailto:?subject=github-action-spacelift-stack-deploy&body=https://github.com/cloudposse/github-action-spacelift-stack-deploy
317-
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/github-action-spacelift-stack-deploy?pixel&cs=github&cm=readme&an=github-action-spacelift-stack-deploy
318-
<!-- markdownlint-restore -->
192+
<img alt="Beacon" width="0" src="https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/github-action-spacelift-stack-deploy?pixel&cs=github&cm=readme&an=github-action-spacelift-stack-deploy"/>

action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
stack:
1212
required: true
1313
description: "Stack name"
14+
autodeploy:
15+
required: false
16+
description: "If true, automatically deploy the stack without manual confirmation"
17+
default: "false"
1418
api_key_id:
1519
required: true
1620
description: "API Key ID"
@@ -43,8 +47,13 @@ runs:
4347
SPACELIFT_API_KEY_ID: ${{ inputs.api_key_id }}
4448
SPACELIFT_API_KEY_SECRET: ${{ inputs.api_key_secret }}
4549
run: |
46-
spacectl stack deploy --id=${{ inputs.stack }} --tail
50+
if [ "${{ inputs.autodeploy }}" = "true" ]; then
51+
spacectl stack deploy --id=${{ inputs.stack }} --tail --auto-confirm
52+
else
53+
spacectl stack deploy --id=${{ inputs.stack }} --tail
54+
fi
55+
4756
RESULT=$(spacectl stack outputs --id=${{ inputs.stack }} --no-color --output json | \
4857
jq 'map({id: .id, value: (.value | fromjson) })' -c -e -M
4958
)
50-
echo "result=${RESULT}" >> $GITHUB_OUTPUT
59+
echo "result=${RESULT}" >> $GITHUB_OUTPUT

docs/github-action.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
|------|-------------|---------|----------|
77
| api\_key\_id | API Key ID | N/A | true |
88
| api\_key\_secret | API Key Secret | N/A | true |
9+
| autodeploy | If true, automatically deploy the stack without manual confirmation | false | false |
910
| github\_token | GitHub Token (Required to install Spacelift CLI) | N/A | true |
1011
| organization | Organization name | N/A | true |
1112
| stack | Stack name | N/A | true |

0 commit comments

Comments
 (0)