-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release action, triggered from tag
It's the same as in console-pluigin repo
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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,56 @@ | ||
name: release to quay.io | ||
on: | ||
push: | ||
tags: [v*] | ||
|
||
env: | ||
REGISTRY_USER: netobserv+github_ci | ||
REGISTRY_PASSWORD: ${{ secrets.QUAY_SECRET }} | ||
REGISTRY: quay.io/netobserv | ||
IMAGE: flowlogs-pipeline | ||
|
||
jobs: | ||
push-image: | ||
name: push image | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
go: ['1.17'] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: validate tag | ||
id: validate_tag | ||
run: | | ||
tag=`git describe --exact-match --tags 2> /dev/null` | ||
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then | ||
echo "$tag is a valid release tag" | ||
set -e | ||
echo "::set-output name=tag::$tag" | ||
else | ||
echo "$tag is NOT a valid release tag" | ||
exit 1 | ||
fi | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: build images | ||
run: DOCKER_TAG=${{ steps.validate_tag.outputs.tag }} make build-images | ||
- name: podman login to quay.io | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
username: ${{ env.REGISTRY_USER }} | ||
password: ${{ env.REGISTRY_PASSWORD }} | ||
registry: quay.io | ||
- name: push to quay.io | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ env.IMAGE }} | ||
tags: ${{ steps.validate_tag.outputs.tag }} | ||
registry: ${{ env.REGISTRY }} | ||
- name: print image url | ||
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" |