|
| 1 | +name: Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + tags: ['v*'] |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +env: |
| 10 | + REGISTRY: ghcr.io |
| 11 | + IMAGE_NAME: ${{ github.repository }} |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-and-push: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + permissions: |
| 17 | + contents: read |
| 18 | + packages: write |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Log in to Container Registry |
| 24 | + uses: docker/login-action@v3 |
| 25 | + with: |
| 26 | + registry: ${{ env.REGISTRY }} |
| 27 | + username: ${{ github.actor }} |
| 28 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + |
| 30 | + - name: Extract metadata |
| 31 | + id: meta |
| 32 | + uses: docker/metadata-action@v5 |
| 33 | + with: |
| 34 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 35 | + tags: | |
| 36 | + type=ref,event=branch |
| 37 | + type=ref,event=tag |
| 38 | + type=sha,prefix= |
| 39 | + type=raw,value=latest,enable={{is_default_branch}} |
| 40 | +
|
| 41 | + - name: Build and push operator |
| 42 | + uses: docker/build-push-action@v5 |
| 43 | + with: |
| 44 | + context: . |
| 45 | + push: true |
| 46 | + tags: ${{ steps.meta.outputs.tags }} |
| 47 | + labels: ${{ steps.meta.outputs.labels }} |
| 48 | + |
| 49 | + - name: Extract s3fs metadata |
| 50 | + id: s3fs-meta |
| 51 | + uses: docker/metadata-action@v5 |
| 52 | + with: |
| 53 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/s3fs |
| 54 | + tags: | |
| 55 | + type=ref,event=tag |
| 56 | + type=raw,value=latest,enable=${{ github.ref_type == 'tag' || github.ref == 'refs/heads/main' }} |
| 57 | + type=sha,prefix= |
| 58 | +
|
| 59 | + - name: Build and push s3fs |
| 60 | + uses: docker/build-push-action@v5 |
| 61 | + with: |
| 62 | + context: docker/s3fs |
| 63 | + push: true |
| 64 | + tags: ${{ steps.s3fs-meta.outputs.tags }} |
| 65 | + labels: ${{ steps.s3fs-meta.outputs.labels }} |
| 66 | + |
| 67 | + - name: Notify release result |
| 68 | + if: always() && startsWith(github.ref, 'refs/tags/v') |
| 69 | + uses: marimo-team/internal-gh-actions/release-notification@main |
| 70 | + with: |
| 71 | + status: ${{ job.status }} |
| 72 | + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_RELEASES }} |
| 73 | + artifact-url: "https://github.com/${{ github.repository }}/pkgs/container/marimo-operator" |
0 commit comments