feat!: rebrand hon.ey to Badger with badger mark and dark+honey theme #13
This file contains hidden or 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: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| # Prevent overlapping releases from racing each other. | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # create tags, releases, push changelog commit | |
| issues: write # comment on released issues | |
| pull-requests: write # comment on released PRs | |
| packages: write # push the container image to GHCR | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| # Determines the next version from conventional commits, updates the | |
| # changelog + package.json, creates the git tag and GitHub release, and | |
| # exports the version via @semantic-release/exec -> $GITHUB_OUTPUT. | |
| - name: Semantic release | |
| id: semrel | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Everything below only runs when a new version was actually published. | |
| - name: Compute image name & tags | |
| if: steps.semrel.outputs.version != '' | |
| run: | | |
| echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV" | |
| VER='${{ steps.semrel.outputs.version }}' | |
| { | |
| echo "TAG_VERSION=$VER" | |
| echo "TAG_MAJOR_MINOR=${VER%.*}" | |
| } >> "$GITHUB_ENV" | |
| - name: Set up Docker Buildx | |
| if: steps.semrel.outputs.version != '' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| if: steps.semrel.outputs.version != '' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push release image | |
| if: steps.semrel.outputs.version != '' | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_VERSION }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_MAJOR_MINOR }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| labels: | | |
| org.opencontainers.image.version=${{ env.TAG_VERSION }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |