Skip to content

Release

Release #11

Workflow file for this run

---
name: Release
on:
push:
tags:
- v[0-9]+.*
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Release
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.github_token }}
git-message: 'chore(release): {version}'
tag-prefix: 'v'
# skip-git-pull: "true"
skip-on-empty: "true"
output-file: "CHANGELOG.md"
version-file: ./package.json
preset: 'angular'
# preset: "conventionalcommits"
release-count: 0
- name: Create Release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
# - name: Generate release notes
# uses: softprops/action-gh-release@v2
# if: ${{ steps.changelog.outputs.skipped == 'false' }}
# # if: startsWith(github.ref, 'refs/tags/v')
# env:
# GITHUB_TOKEN: ${{ secrets.github_token }}
# with:
# tag_name: ${{ steps.changelog.outputs.tag }}
# # release_name: ${{ steps.changelog.outputs.tag }}
# body: ${{ steps.changelog.outputs.clean_changelog }}
# files: |
# generate_release_notes: true
# # body_path: CHANGELOG.md
image:
runs-on: [ubuntu-latest]
needs: [release]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gorabbit/node-app
ghcr.io/jacekzubielik/node-app
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
# type=sha
# type=schedule
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
platforms: amd64,arm64
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
outputs: |
type=image,name=target
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: gorabbit/node-app
readme-filepath: ./README.md