Merge pull request #2 from ykulazhenkov/pr-build-script #1
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: "Push images on merge to master" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set repository as lower-case output variable | |
| id: repo_name | |
| run: | | |
| echo "repository=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')"-controller >> "$GITHUB_OUTPUT" | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Extract metadata | |
| id: docker_meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ steps.repo_name.outputs.repository }} | |
| tags: | | |
| type=ref,event=branch | |
| type=sha,prefix={{branch}}- | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push multiarch container image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ghcr.io/${{ steps.repo_name.outputs.repository }}:latest | |
| ghcr.io/${{ steps.repo_name.outputs.repository }}:${{ github.sha }} | |
| labels: ${{ steps.docker_meta.outputs.labels }} | |
| file: ./deploy/image/Dockerfile.nvidia |