Merge pull request #3 from voxpupuli/make_it_work #1
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: Build and publish a 🛢️ container | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
build-and-push-container: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Source checkout | |
uses: actions/checkout@v4 | |
- name: Get commitlint version | |
id: get_version | |
run: echo "cl_version="$(jq -r '.dependencies."@commitlint/cli"' package.json | sed 's/\^//') >> $GITHUB_OUTPUT | |
# Parse ref_name and if it is main, change it to latest | |
- name: Set tag | |
id: set_tag | |
run: echo "tag=$(echo ${{ github.ref_name }} | sed 's/^main$/latest/')" >> $GITHUB_OUTPUT | |
- name: Build Vox Pupuli commitlint container | |
uses: voxpupuli/gha-build-and-publish-a-container@v2 | |
with: | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
build_arch: linux/amd64,linux/arm64 | |
docker_username: voxpupulibot | |
docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} | |
tags: | | |
ghcr.io/voxpupuli/commitlint:${{ steps.get_version.outputs.cl_version }}-${{ steps.set_tag.outputs.tag }} | |
ghcr.io/voxpupuli/commitlint:latest | |
docker.io/voxpupuli/commitlint:${{ steps.get_version.outputs.cl_version }}-${{ steps.set_tag.outputs.tag }} | |
docker.io/voxpupuli/commitlint:latest | |
- name: Update Docker Hub Description | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: voxpupulibot | |
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} | |
repository: voxpupuli/commitlint |