Merge pull request #274 from element-hq/dependabot/npm_and_yarn/npm_a… #1041
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: Build Synapse Guest Module | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build-py: | |
| name: Build Python | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| working-directory: ./modules/restricted-guests/synapse/ | |
| env: | |
| DOCKER_IMAGE: ghcr.io/element-hq/synapse-guest-module | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Login to ghcr.io | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Generate Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5 | |
| env: | |
| DOCKER_METADATA_PR_HEAD_SHA: true | |
| with: | |
| images: ${{ env.DOCKER_IMAGE }} | |
| labels: | | |
| org.opencontainers.image.title=Synapse Guest Module | |
| org.opencontainers.image.description=A synapse module to restrict the actions of guests | |
| org.opencontainers.image.vendor=New Vector Ltd. | |
| tags: | | |
| type=sha,prefix= | |
| - name: Docker build and push | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6 | |
| id: dockerBuild | |
| with: | |
| push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| context: modules/restricted-guests/synapse | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64,linux/arm64,linux/s390x | |
| sbom: true | |
| provenance: true |