This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
e9d6d93
commit cccd7b7
Showing
7 changed files
with
143 additions
and
78 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: '$RESOLVED_VERSION' | ||
version-template: '$MAJOR.$MINOR.$PATCH' | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
- 'enhancement' | ||
patch: | ||
labels: | ||
- 'patch' | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- 'hotfix' | ||
default: 'minor' | ||
|
||
categories: | ||
- title: '🚀 Enhancements' | ||
labels: | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- 'hotfix' | ||
|
||
change-template: | | ||
<details> | ||
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary> | ||
$BODY | ||
</details> | ||
template: | | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: auto-release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
semver: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
publish: true | ||
prerelease: false | ||
config-name: auto-release.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: "docker" | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout source code at current commit" | ||
uses: actions/checkout@v2 | ||
- name: Prepare tags for Docker image | ||
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository | ||
id: prepare | ||
run: | | ||
TAGS=${{ github.repository }}:sha-${GITHUB_SHA:0:7} | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/} | ||
elif [[ $GITHUB_REF == refs/pull/* ]]; then | ||
VERSION=pr-${{ github.event.pull_request.number }}-merge | ||
fi | ||
if [[ -n $VERSION ]]; then | ||
TAGS="$TAGS,${{ github.repository }}:${VERSION}" | ||
fi | ||
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,${{ github.repository }}:latest" | ||
fi | ||
echo ::set-output name=tags::${TAGS} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: "Build and push docker image to DockerHub" | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: ${{ (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository }} | ||
tags: ${{ steps.prepare.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters