Skip to content

release

release #25

Workflow file for this run

name: release
on:
workflow_run:
workflows: [ci]
branches: [main]
types: [completed]
jobs:
prepare:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
new_tag: ${{ steps.version.outputs.new_tag }}
changelog: ${{ steps.version.outputs.changelog }}
steps:
- name: Bump release version and push tag
id: version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
publish:
runs-on: ubuntu-latest
needs: prepare
if: needs.prepare.outputs.new_tag != ''
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare tags for docker image
id: meta
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/sergeii/swat4master
tags: |
type=raw,prefix=,value=${{ needs.prepare.outputs.new_tag }}
flavor: |
latest=true
prefix=
suffix=
- name: Build and push docker image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.prepare.outputs.new_tag }}
name: Release ${{ needs.prepare.outputs.new_tag }}
body: ${{ needs.prepare.outputs.changelog }}