diff --git a/.github/workflows/make-release.yaml b/.github/workflows/make-release.yaml new file mode 100644 index 0000000..e4edeb0 --- /dev/null +++ b/.github/workflows/make-release.yaml @@ -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/login-action@v1.10.0 + 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