fix: enhance docker configuration for streamlined builds #8
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 & Publish Docker Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write # For git tag + changelog commit | |
| packages: write # For pushing to GHCR | |
| jobs: | |
| release-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed to get tags for semantic-release | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Install go-semantic-release | |
| run: | | |
| go install github.com/go-semantic-release/semantic-release/v2/cmd/semantic-release@latest | |
| echo "${HOME}/go/bin" >> $GITHUB_PATH | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.APP_ID }} | |
| private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Configure Git user | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Run semantic-release | |
| id: semrel | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| semantic-release version --provider github |