fix release conflict #3
Workflow file for this run
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: Build and Push Docker Image | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc. | |
| env: | |
| DOCKER_IMAGE_NAME: awkto/kea-gui-reservations # Change to your Docker Hub username/repo | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: extract_version | |
| run: | | |
| # Remove 'v' prefix from tag to get version | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version: $VERSION" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.extract_version.outputs.VERSION }} | |
| ${{ env.DOCKER_IMAGE_NAME }}:latest | |
| platforms: linux/amd64,linux/arm64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Create or Update GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| generate_release_notes: true | |
| fail_on_unmatched_files: false | |
| body: | | |
| ## Docker Image | |
| Pull the image: | |
| ```bash | |
| docker pull ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.extract_version.outputs.VERSION }} | |
| # or | |
| docker pull ${{ env.DOCKER_IMAGE_NAME }}:latest | |
| ``` | |
| Run the container: | |
| ```bash | |
| docker run -p 5000:5000 \ | |
| -v $(pwd)/config.yaml:/app/config/config.yaml:ro \ | |
| ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.extract_version.outputs.VERSION }} | |
| ``` | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |