feat: update github actions
This commit is contained in:
parent
ff14fd4678
commit
65e868893a
2 changed files with 62 additions and 144 deletions
137
.github/workflows/docker_build_push.yml
vendored
137
.github/workflows/docker_build_push.yml
vendored
|
|
@ -1,18 +1,46 @@
|
||||||
name: Build and Publish Docker
|
name: Build and Publish Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- "develop"
|
||||||
- develop
|
- "main"
|
||||||
- "feat/s2n-quic"
|
pull_request:
|
||||||
|
types: [synchronize, opened]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY_IMAGE: jqtype/rpxy
|
GHCR: ghcr.io
|
||||||
|
GHCR_IMAGE_NAME: ${{ github.repository }}
|
||||||
|
DH_REGISTRY_NAME: jqtype/rpxy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_push:
|
build_and_push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: "default"
|
||||||
|
dockerfile: ./docker/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
- target: "default-slim"
|
||||||
|
dockerfile: ./docker/Dockerfile.slim
|
||||||
|
build-contexts: |
|
||||||
|
messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl
|
||||||
|
messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags-suffix: "-slim"
|
||||||
|
# Aliases must be used only for release builds
|
||||||
|
aliases: |
|
||||||
|
"slim"
|
||||||
|
|
||||||
|
- 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,linux/arm64
|
||||||
|
tags-suffix: "-s2n"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -20,14 +48,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: GitHub Environment
|
|
||||||
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY_IMAGE }}
|
images: ${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
@ -35,87 +60,49 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.GHCR }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Release build and push
|
- name: Nightly build and push
|
||||||
if: ${{ env.BRANCH == 'main' }}
|
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
build-args: ${{ matrix.build-args }}
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY_IMAGE }}:latest
|
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:nightly${{ matrix.tags-suffix }}
|
||||||
file: ./docker/Dockerfile
|
${{ env.DH_REGISTRY_NAME }}:nightly${{ matrix.tags-suffix }}
|
||||||
cache-from: type=gha
|
build-contexts: ${{ matrix.build-contexts }}
|
||||||
cache-to: type=gha,mode=max
|
file: ${{ matrix.dockerfile }}
|
||||||
platforms: linux/amd64,linux/arm64
|
cache-from: type=gha,scope=rpxy-nightly-${{ matrix.target }}
|
||||||
|
cache-to: type=gha,mode=max,scope=rpxy-nightly-${{ matrix.target }}
|
||||||
|
platforms: ${{ matrix.platforms }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
- name: Release build and push slim
|
- name: Release build and push slim
|
||||||
if: ${{ env.BRANCH == 'main' }}
|
if: ${{ github.ref_name == 'main' }}
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
build-args: ${{ matrix.build-args }}
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY_IMAGE }}:slim, ${{ env.REGISTRY_IMAGE }}:latest-slim
|
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:latest${{ matrix.tags-suffix }}
|
||||||
build-contexts: |
|
${{ env.DH_REGISTRY_NAME }}:latest${{ matrix.tags-suffix }}
|
||||||
messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl
|
${{ matrix.aliases }}
|
||||||
messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl
|
build-contexts: ${{ matrix.build-contexts }}
|
||||||
file: ./docker/Dockerfile.slim
|
file: ${{ matrix.dockerfile }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha,scope=rpxy-latest-${{ matrix.target }}
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max,scope=rpxy-latest-${{ matrix.target }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: ${{ matrix.platforms }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
- name: Nightly build and push
|
|
||||||
if: ${{ env.BRANCH == 'develop' }}
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ env.REGISTRY_IMAGE }}:nightly
|
|
||||||
file: ./docker/Dockerfile
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# 今Pushし放題なので注意
|
|
||||||
- name: Nightly build and push s2n-quic
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
build-args: |
|
|
||||||
"CARGO_FEATURES=--no-default-features --features http3-s2n"
|
|
||||||
"ADDITIONAL_DEPS=pkg-config libssl-dev cmake libclang1 gcc g++"
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ env.REGISTRY_IMAGE }}:nightly-s2n
|
|
||||||
file: ./docker/Dockerfile
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
platforms: linux/amd64
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
- name: Nightly build and push slim
|
|
||||||
if: ${{ env.BRANCH == 'develop' }}
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
${{ env.REGISTRY_IMAGE }}:nightly-slim
|
|
||||||
build-contexts: |
|
|
||||||
messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl
|
|
||||||
messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl
|
|
||||||
file: ./docker/Dockerfile.slim
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
|
||||||
69
.github/workflows/ghcr_build_push.yml
vendored
69
.github/workflows/ghcr_build_push.yml
vendored
|
|
@ -1,69 +0,0 @@
|
||||||
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 }}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue