|
| 1 | +name: Build and publish EESSI Docker image used for building the compatibility layer |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + paths: |
| 7 | + - Dockerfile.build-node-compat-layer-* |
| 8 | + - bootstrap-prefix.sh |
| 9 | + |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + paths: |
| 14 | + - Dockerfile.build-node-compat-layer-* |
| 15 | + - bootstrap-prefix.sh |
| 16 | + |
| 17 | +# Declare default permissions as read only. |
| 18 | +permissions: read-all |
| 19 | + |
| 20 | +jobs: |
| 21 | + build_and_publish: |
| 22 | + name: Build and publish image |
| 23 | + runs-on: ubuntu-24.04-arm |
| 24 | + permissions: |
| 25 | + packages: write |
| 26 | + strategy: |
| 27 | + matrix: |
| 28 | + include: |
| 29 | + - os: 'debian-12' |
| 30 | + platform: 'amd64, arm64' |
| 31 | + - os: 'debian-13' |
| 32 | + platform: 'amd64, arm64, riscv64' |
| 33 | + steps: |
| 34 | + - name: Check out the repo |
| 35 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 36 | + |
| 37 | + - name: Set up QEMU |
| 38 | + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 |
| 39 | + |
| 40 | + - name: Set up Docker Buildx |
| 41 | + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 |
| 42 | + |
| 43 | + - name: Login to GitHub Container Registry |
| 44 | + if: github.event_name != 'pull_request' |
| 45 | + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 |
| 46 | + with: |
| 47 | + registry: ghcr.io |
| 48 | + username: ${{ github.repository_owner }} |
| 49 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + |
| 51 | + - name: Convert and store repository owner in lowercase |
| 52 | + run: | |
| 53 | + echo "REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV |
| 54 | +
|
| 55 | + - name: Build and push to GitHub Packages |
| 56 | + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 |
| 57 | + with: |
| 58 | + tags: ghcr.io/${{ env.REPOSITORY_OWNER }}/build-node-compat-layer:${{ matrix.os }} |
| 59 | + file: Dockerfile.build-node-compat-layer-${{ matrix.os }} |
| 60 | + platforms: ${{ matrix.platform }} |
| 61 | + push: ${{ github.event_name != 'pull_request' }} |
0 commit comments