-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 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,47 @@ | ||
name: Create docker release and github release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release version number' | ||
required: true | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push a Docker image to the Docker Hub and create a github release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/shift-left-netconfig/netpol-synth:${{ github.event.inputs.version }} | ||
|
||
- name: Create and push a new git tag | ||
run: | | ||
git config user.name ${{ github.actor }} | ||
git tag -a v${{ github.event.inputs.version }} -m "Version ${{ github.event.inputs.version }}" | ||
git push origin v${{ github.event.inputs.version }} | ||
- name: Create a github release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ github.event.inputs.version }} | ||
release_name: Release v${{ github.event.inputs.version }} | ||
body: | | ||
Changes in this Release: | ||
draft: false | ||
prerelease: false |