Skip to content

Bump softprops/action-gh-release from 1 to 2 #16

Bump softprops/action-gh-release from 1 to 2

Bump softprops/action-gh-release from 1 to 2 #16

Workflow file for this run

name: Release
on:
push:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Environment - Setup buildx
uses: docker/setup-buildx-action@v1
- name: Setup Environment - Set variable `push-to-registry`
id: push-to-registry
uses: actions-ecosystem/action-regex-match@v2
with:
text: ${{ github.ref }}
regex: ^refs\/tags\/
- name: Setup Environment - Login to Github Container Registry
uses: docker/login-action@v1
if: ${{ steps.push-to-registry.outputs.match != '' }}
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment - Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build
uses: docker/build-push-action@v2
with:
context: .
push: ${{ steps.push-to-registry.outputs.match != '' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
create-release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build-docker
steps:
- name: Setup Environment - Set variable `check-if-prelease`
id: check-if-prelease
uses: actions-ecosystem/action-regex-match@v2
with:
text: ${{ github.ref }}
regex: ^refs\/tags\/v?[0-9]+\.[0-9]+\.[0-9]+\-
- name: Create Release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ steps.check-if-prelease.outputs.match != '' }}
fail_on_unmatched_files: true
discussion_category_name: Announcements