Docker-AI-v0.2.4 #4
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: Publish Docker Image and Debian Package | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-publish-docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to the GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-and-upload-deb: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Needed to upload release assets | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Set up build variables | |
| id: build_vars | |
| run: | | |
| RELEASE_VERSION=${{ github.ref_name }} | |
| VERSION_NUMBER=${RELEASE_VERSION#v} | |
| echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV | |
| sed -i "s/^VERSION=.*/VERSION=\"${VERSION_NUMBER}\"/" build_packages.sh | |
| - name: Build the Debian package | |
| run: bash build_packages.sh | |
| - name: List files to debug | |
| run: ls -lR | |
| - name: Upload Debian package to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: docker-ai_${{ env.VERSION_NUMBER }}_amd64.deb | |
| asset_name: docker-ai_${{ github.ref_name }}_amd64.deb | |
| tag: ${{ github.ref_name }} | |
| overwrite: true |