Skip to content

Merge pull request #37 from ichisuke55/release-please--branches--main #43

Merge pull request #37 from ichisuke55/release-please--branches--main

Merge pull request #37 from ichisuke55/release-please--branches--main #43

Workflow file for this run

name: release
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release-please
id: release
uses: google-github-actions/release-please-action@v4
with:
release-type: go
default-branch: main
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
- name: Set up buildx
if: ${{ steps.release.outputs.release_created }}
uses: docker/setup-buildx-action@v3
- name: Extract tag from release-please
if: ${{ steps.release.outputs.release_created }}
run: |
if [ -n "${{ steps.release.outputs.tag_name }}" ]; then
echo "TAG=${{ steps.release.outputs.tag_name }}" >> $GITHUB_ENV
fi
- name: Set image and tag
if: ${{ steps.release.outputs.release_created }}
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/ichisuke55/translate-bot
tags: |
type=semver,pattern={{version}},value=${{ env.TAG }}
- name: Login to ghcr
if: ${{ steps.release.outputs.release_created }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
if: ${{ steps.release.outputs.release_created }}
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}