Initial commit #5
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 mcrouter | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- LICENSE | |
- README.md | |
- .github/dependabot.yml | |
pull_request: | |
paths-ignore: | |
- LICENSE | |
- README.md | |
- .github/dependabot.yml | |
jobs: | |
build_mcrouter_debian_bookworm: | |
name: Build Debian Bookworm mcrouter package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: infra | |
- name: Fetch mcrouter | |
run: ./infra/fetch.sh | |
- name: Build and test mcrouter | |
run: | | |
docker build -f ./infra/Dockerfile-debian --target builder -t buildenv . | |
docker run --rm --name buildenv -v $(pwd):/build -w /build buildenv ./infra/build-and-test.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mcrouter-debian-bookworm | |
path: fbcode-scratch/build/mcrouter/mcrouter.deb | |
push_mcrouter_debian_bookworm: | |
name: Push Debian Bookworm mcrouter image | |
needs: build_mcrouter_debian_bookworm | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download mcrouter package | |
uses: actions/download-artifact@v4 | |
with: | |
name: mcrouter-debian-bookworm | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ github.token }} | |
- name: Populate docker metadata | |
id: docker-meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/mszabo-wikia/mcrouter-debian-bookworm | |
tags: | |
type=sha,prefix={{date YYYYMMDD}}- | |
- name: Build and push mcrouter image | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile-debian | |
push: ${{ github.event_name == 'push' }} | |
target: base | |
tags: ${{ steps.docker-meta.outputs.tags }} | |
labels: ${{ steps.docker-meta.outputs.labels }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v2 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
subject-name: ghcr.io/mszabo-wikia/mcrouter-debian-bookworm | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true |