|
| 1 | +name: Build and Push Nushell Binaries @ Debian |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - docker/debian.Dockerfile |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-and-push-Nu: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + packages: write |
| 17 | + steps: |
| 18 | + - name: Checkout Code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + ref: main |
| 22 | + |
| 23 | + - name: Set up Nushell |
| 24 | + uses: hustcer/setup-nu@v3 |
| 25 | + with: |
| 26 | + check-latest: true |
| 27 | + |
| 28 | + - name: Set up QEMU |
| 29 | + uses: docker/setup-qemu-action@v3 |
| 30 | + |
| 31 | + - name: Set up Docker Buildx |
| 32 | + uses: docker/setup-buildx-action@v3 |
| 33 | + |
| 34 | + - name: Login to GitHub Container Registry |
| 35 | + uses: docker/login-action@v3 |
| 36 | + with: |
| 37 | + registry: ghcr.io |
| 38 | + username: ${{ github.actor }} |
| 39 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + |
| 41 | + - name: "Set tag & labels for ${{ github.ref }}" |
| 42 | + shell: nu {0} |
| 43 | + run: | |
| 44 | + $'BUILD_REF=(git rev-parse --short HEAD)(char nl)' o>> $env.GITHUB_ENV |
| 45 | + $'BUILD_DATE=(date now | format date %Y-%m-%dT%H:%M:%SZ)(char nl)' o>> $env.GITHUB_ENV |
| 46 | + let tagName = http get https://api.github.com/repos/nushell/nushell/releases |
| 47 | + | sort-by -r created_at | select tag_name | get tag_name.0 |
| 48 | + $'NU_VERSION=($tagName)(char nl)' o>> $env.GITHUB_ENV |
| 49 | +
|
| 50 | + - name: Build and Push Debian Image |
| 51 | + uses: docker/build-push-action@v6 |
| 52 | + with: |
| 53 | + push: true |
| 54 | + context: ./docker |
| 55 | + file: ./docker/debian.Dockerfile |
| 56 | + platforms: linux/amd64,linux/arm64,linux/arm/v7 |
| 57 | + # platforms: linux/amd64,linux/arm64,linux/riscv64 |
| 58 | + build-args: | |
| 59 | + BUILD_REF=${{ env.BUILD_REF }} |
| 60 | + BUILD_DATE=${{ env.BUILD_DATE }} |
| 61 | + NU_VERSION=${{ env.NU_VERSION }} |
| 62 | + tags: | |
| 63 | + ghcr.io/nushell/nushell:latest-bookworm |
| 64 | + ghcr.io/nushell/nushell:${{ env.NU_VERSION }}-bookworm |
0 commit comments