|
57 | 57 | - name: publish to pypi |
58 | 58 | uses: pypa/gh-action-pypi-publish@release/v1 |
59 | 59 | if: startsWith(github.ref, 'refs/tags/') |
| 60 | + |
| 61 | + build-docker-images: |
| 62 | + runs-on: ubuntu-22.04 |
| 63 | + permissions: |
| 64 | + contents: read |
| 65 | + strategy: |
| 66 | + fail-fast: false |
| 67 | + matrix: |
| 68 | + vncserver: [tigervnc, turbovnc] |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + with: |
| 72 | + fetch-depth: 0 |
| 73 | + |
| 74 | + - name: Calculate image tags |
| 75 | + id: tags |
| 76 | + uses: jupyterhub/action-major-minor-tag-calculator@v3 |
| 77 | + with: |
| 78 | + githubToken: ${{ github.token }} |
| 79 | + prefix: "" |
| 80 | + suffix: "-${{ matrix.vncserver }}" |
| 81 | + |
| 82 | + - name: Set up QEMU |
| 83 | + uses: docker/setup-qemu-action@v3 |
| 84 | + |
| 85 | + - name: Set up Docker Buildx |
| 86 | + uses: docker/setup-buildx-action@v3 |
| 87 | + |
| 88 | + - name: Login to Quay.io |
| 89 | + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') |
| 90 | + uses: docker/login-action@v3 |
| 91 | + with: |
| 92 | + registry: quay.io |
| 93 | + username: ${{ secrets.QUAY_USERNAME }} |
| 94 | + password: ${{ secrets.QUAY_PASSWORD }} |
| 95 | + |
| 96 | + - name: Build and push Docker image |
| 97 | + uses: docker/build-push-action@v6 |
| 98 | + with: |
| 99 | + context: . |
| 100 | + platforms: linux/amd64,linux/arm64 |
| 101 | + push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} |
| 102 | + tags: ${{ steps.tags.outputs.tags }} |
| 103 | + build-args: | |
| 104 | + vncserver=${{ matrix.vncserver }} |
| 105 | + cache-from: type=gha,scope=${{ matrix.vncserver }} |
| 106 | + cache-to: type=gha,mode=max,scope=${{ matrix.vncserver }} |
0 commit comments