release #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: release | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
permissions: read-all | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
semantic-release: | |
name: Semantic release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
if: ${{ github.event_name != 'pull_request' && github.event_name != 'release' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
extra_plugins: | | |
conventional-changelog-conventionalcommits@5.0.0 | |
env: | |
# workflows created by GITHUB_TOKEN cannot trigger other workflows, see below | |
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} | |
docker-build-and-push: | |
strategy: | |
matrix: | |
context-path: [./rdc/docker-web, ./rdc/docker-mysql, ./rdc/docker-cron] | |
name: Docker build & publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Log in to the Container registry | |
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=semver,pattern={{version}} | |
# set latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.context-path }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |