diff --git a/.github/workflows/ghcr_build_push.yml b/.github/workflows/ghcr_build_push.yml new file mode 100644 index 0000000..84317fb --- /dev/null +++ b/.github/workflows/ghcr_build_push.yml @@ -0,0 +1,69 @@ +name: Build and Publish Docker Images to ghcr.io + +on: + push: + branches: + - "feat/s2n-quic" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build_and_push: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - target: "default" + dockerfile: ./docker/Dockerfile + platforms: linux/amd64 + + - target: "s2n" + dockerfile: ./docker/Dockerfile + build-args: | + "CARGO_FEATURES=--no-default-features --features http3-s2n" + "ADDITIONAL_DEPS=pkg-config libssl-dev cmake libclang1 gcc g++" + platforms: linux/amd64 + tags-suffix: "-s2n" + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # 今Pushし放題なので注意 + - name: Nightly build and push + uses: docker/build-push-action@v4 + with: + context: . + build-args: ${{ matrix.build-args }} + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly${{ matrix.tags-suffix }} + file: ${{ matrix.dockerfile }} + cache-from: type=gha,scope=rpxy-${{ matrix.target }} + cache-to: type=gha,mode=max,scope=rpxy-${{ matrix.target }} + platforms: ${{ matrix.platforms }} + labels: ${{ steps.meta.outputs.labels }}