Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Commit cccd7b7

Browse files
danjbhaknysh
andauthored
Adding auto-release & updating docker Github workflows (#57)
* Adding auto-release & updating docker Github workflows * Removing old build-and-push workflow * Update GitHub workflows * Update GitHub workflows Co-authored-by: Dan Meyers <[email protected]> Co-authored-by: aknysh <[email protected]>
1 parent e9d6d93 commit cccd7b7

File tree

7 files changed

+143
-78
lines changed

7 files changed

+143
-78
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212

1313
# Cloud Posse must review any changes to GitHub actions
1414
.github/* @cloudposse/engineering
15+
16+
# Cloud Posse must review any changes to standard context definition
17+
**/context.tf @cloudposse/engineering

.github/auto-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '$MAJOR.$MINOR.$PATCH'
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
- 'enhancement'
12+
patch:
13+
labels:
14+
- 'patch'
15+
- 'fix'
16+
- 'bugfix'
17+
- 'bug'
18+
- 'hotfix'
19+
default: 'minor'
20+
21+
categories:
22+
- title: '🚀 Enhancements'
23+
labels:
24+
- 'enhancement'
25+
- title: '🐛 Bug Fixes'
26+
labels:
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- 'hotfix'
31+
32+
change-template: |
33+
<details>
34+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
35+
36+
$BODY
37+
</details>
38+
39+
template: |
40+
$CHANGES

.github/workflows/auto-release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: auto-release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
semver:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
- uses: release-drafter/release-drafter@v5
14+
with:
15+
publish: true
16+
prerelease: false
17+
config-name: auto-release.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}

.github/workflows/build-and-push.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/docker.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "docker"
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
release:
6+
types:
7+
- created
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "Checkout source code at current commit"
13+
uses: actions/checkout@v2
14+
- name: Prepare tags for Docker image
15+
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository
16+
id: prepare
17+
run: |
18+
TAGS=${{ github.repository }}:sha-${GITHUB_SHA:0:7}
19+
if [[ $GITHUB_REF == refs/tags/* ]]; then
20+
VERSION=${GITHUB_REF#refs/tags/}
21+
elif [[ $GITHUB_REF == refs/pull/* ]]; then
22+
VERSION=pr-${{ github.event.pull_request.number }}-merge
23+
fi
24+
if [[ -n $VERSION ]]; then
25+
TAGS="$TAGS,${{ github.repository }}:${VERSION}"
26+
fi
27+
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
28+
TAGS="$TAGS,${{ github.repository }}:latest"
29+
fi
30+
echo ::set-output name=tags::${TAGS}
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v1
33+
- name: Login to DockerHub
34+
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository
35+
uses: docker/login-action@v1
36+
with:
37+
username: ${{ secrets.DOCKERHUB_USERNAME }}
38+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
39+
- name: "Build and push docker image to DockerHub"
40+
id: docker_build
41+
uses: docker/build-push-action@v2
42+
with:
43+
push: ${{ (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository }}
44+
tags: ${{ steps.prepare.outputs.tags }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2018 Cloud Posse, LLC
189+
Copyright 2018-2020 Cloud Posse, LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 36 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
<!--
2-
3-
4-
5-
6-
7-
1+
# Cloud Posse Reference Architectures
82

3+
[![Latest Release](https://img.shields.io/github/release/cloudposse/reference-architectures.svg)](https://github.com/cloudposse/reference-architectures/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) [![Discourse Forum](https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg)](https://ask.sweetops.com/)
94

5+
[![README Header][readme_header_img]][readme_header_link]
106

7+
[![Cloud Posse][logo]](https://cpco.io/homepage)
118

9+
<!--
1210
1311
1412
1513
1614
** DO NOT EDIT THIS FILE
17-
**
18-
** This file was automatically generated by the `build-harness`.
19-
** 1) Make all changes to `README.yaml`
15+
**
16+
** This file was automatically generated by the `build-harness`.
17+
** 1) Make all changes to `README.yaml`
2018
** 2) Run `make init` (you only need to do this once)
21-
** 3) Run`make readme` to rebuild this file.
19+
** 3) Run`make readme` to rebuild this file.
2220
**
2321
** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)
2422
**
@@ -27,25 +25,7 @@
2725
2826
2927
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
-->
41-
[![README Header][readme_header_img]][readme_header_link]
42-
43-
[![Cloud Posse][logo]](https://cpco.io/homepage)
44-
45-
# Cloud Posse Reference Architectures
46-
47-
[![Latest Release](https://img.shields.io/github/release/cloudposse/reference-architectures.svg)](https://github.com/cloudposse/reference-architectures/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) [![Discourse Forum](https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg)](https://ask.sweetops.com/)
48-
28+
-->
4929

5030
Get up and running quickly with one of our reference architectures using our fully automated cold-start process.
5131

@@ -69,7 +49,7 @@ Get up and running quickly with one of our reference architectures using our ful
6949

7050
---
7151

72-
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
52+
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
7353
[<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]
7454
[<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]
7555
[<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]
@@ -273,7 +253,7 @@ Did you get stuck? Find us on [slack](https://sweetops.cloudposse.com) in the `#
273253

274254
## Help
275255

276-
**Got a question?** We got answers.
256+
**Got a question?** We got answers.
277257

278258
File a GitHub [issue](https://github.com/cloudposse/reference-architectures/issues), send us an [email][email] or join our [Slack Community][slack].
279259

@@ -282,7 +262,7 @@ File a GitHub [issue](https://github.com/cloudposse/reference-architectures/issu
282262
## DevOps Accelerator for Startups
283263

284264

285-
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.
265+
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.
286266

287267
[![Learn More](https://img.shields.io/badge/learn%20more-success.svg?style=for-the-badge)][commercial_support]
288268

@@ -311,11 +291,11 @@ Participate in our [Discourse Forums][discourse]. Here you'll find answers to co
311291

312292
## Newsletter
313293

314-
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.
294+
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.
315295

316296
## Office Hours
317297

318-
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
298+
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
319299

320300
[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours]
321301

@@ -349,28 +329,30 @@ Copyright © 2016-2020 [Cloud Posse, LLC](https://cloudposse.com)
349329

350330

351331

352-
## License
332+
## License
353333

354-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
334+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
355335

356336
See [LICENSE](LICENSE) for full details.
357337

358-
Licensed to the Apache Software Foundation (ASF) under one
359-
or more contributor license agreements. See the NOTICE file
360-
distributed with this work for additional information
361-
regarding copyright ownership. The ASF licenses this file
362-
to you under the Apache License, Version 2.0 (the
363-
"License"); you may not use this file except in compliance
364-
with the License. You may obtain a copy of the License at
365-
366-
https://www.apache.org/licenses/LICENSE-2.0
367-
368-
Unless required by applicable law or agreed to in writing,
369-
software distributed under the License is distributed on an
370-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
371-
KIND, either express or implied. See the License for the
372-
specific language governing permissions and limitations
373-
under the License.
338+
```text
339+
Licensed to the Apache Software Foundation (ASF) under one
340+
or more contributor license agreements. See the NOTICE file
341+
distributed with this work for additional information
342+
regarding copyright ownership. The ASF licenses this file
343+
to you under the Apache License, Version 2.0 (the
344+
"License"); you may not use this file except in compliance
345+
with the License. You may obtain a copy of the License at
346+
347+
https://www.apache.org/licenses/LICENSE-2.0
348+
349+
Unless required by applicable law or agreed to in writing,
350+
software distributed under the License is distributed on an
351+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
352+
KIND, either express or implied. See the License for the
353+
specific language governing permissions and limitations
354+
under the License.
355+
```
374356

375357

376358

@@ -392,7 +374,7 @@ This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? P
392374

393375
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❤️ [Open Source Software][we_love_open_source].
394376

395-
We offer [paid support][commercial_support] on all of our projects.
377+
We offer [paid support][commercial_support] on all of our projects.
396378

397379
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.
398380

0 commit comments

Comments
 (0)