Build Docker Image 24-ubuntu-slim with buildx #32
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 Docker Image 24-ubuntu-slim with buildx | |
| on: | |
| # Allow manual dispatch | |
| workflow_dispatch: | |
| # Cancel previous runs when a new one is triggered | |
| concurrency: | |
| group: docker-build-24-ubuntu-slim | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code to main branch | |
| uses: actions/checkout@v7 | |
| - name: Set metadata | |
| id: meta | |
| run: | | |
| VERSION=$(jq -r '.version' package.json) | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "VCS_REF=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | |
| echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| with: | |
| platforms: all | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| with: | |
| version: latest | |
| - name: Run Docker Buildx with Dockerfile.24-ubuntu-slim for version ${{ steps.meta.outputs.VERSION }} | |
| run: | | |
| docker buildx build \ | |
| --no-cache \ | |
| --pull \ | |
| --platform linux/amd64,linux/arm64 \ | |
| -f docker/Dockerfile.24-ubuntu-slim \ | |
| -t luligu/matterbridge:24-ubuntu-slim \ | |
| -t luligu/matterbridge:24-ubuntu-slim-${{ steps.meta.outputs.VERSION }} \ | |
| --build-arg VERSION=${{ steps.meta.outputs.VERSION }} \ | |
| --build-arg VCS_REF=${{ steps.meta.outputs.VCS_REF }} \ | |
| --build-arg BUILD_DATE=${{ steps.meta.outputs.BUILD_DATE }} \ | |
| --push . | |
| docker manifest inspect luligu/matterbridge:24-ubuntu-slim | |
| - name: Trigger Matterbridge Docker Build Ubuntu | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.PAT_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'docker-buildx-ubuntu.yml', | |
| ref: 'main' | |
| }) |