|
| 1 | +name: Local E2E Test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +env: |
| 7 | + GHCR_IMAGE: localhost:5001/neomantra/openresty |
| 8 | + DOCKERHUB_IMAGE: localhost:5002/openresty/openresty |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - flavor: alpine-apk-test |
| 18 | + arch: amd64 |
| 19 | + dockerfile: alpine-apk/Dockerfile |
| 20 | + platforms: linux/amd64 |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set up QEMU |
| 27 | + uses: docker/setup-qemu-action@v3 |
| 28 | + |
| 29 | + # Configure Buildx to allow insecure registries for localhost |
| 30 | + - name: Set up Docker Buildx |
| 31 | + uses: docker/setup-buildx-action@v3 |
| 32 | + with: |
| 33 | + driver-opts: network=host |
| 34 | + buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host |
| 35 | + |
| 36 | + - name: Extract metadata |
| 37 | + id: meta |
| 38 | + uses: docker/metadata-action@v5 |
| 39 | + with: |
| 40 | + images: ${{ env.GHCR_IMAGE }} |
| 41 | + tags: | |
| 42 | + type=raw,value=${{ matrix.flavor }}-${{ matrix.arch }} |
| 43 | +
|
| 44 | + - name: Build and push |
| 45 | + uses: docker/build-push-action@v5 |
| 46 | + with: |
| 47 | + context: . |
| 48 | + file: ${{ matrix.dockerfile }} |
| 49 | + platforms: ${{ matrix.platforms }} |
| 50 | + push: true |
| 51 | + tags: ${{ steps.meta.outputs.tags }} |
| 52 | + labels: ${{ steps.meta.outputs.labels }} |
| 53 | + |
| 54 | + - name: Tag and Push to Mirror |
| 55 | + run: | |
| 56 | + for TAG in ${{ steps.meta.outputs.tags }}; do |
| 57 | + # Replace port 5001 with 5002 for the mirror |
| 58 | + DOCKERHUB_TAG=$(echo "$TAG" | sed "s|5001|5002|") |
| 59 | + docker buildx imagetools create -t "$DOCKERHUB_TAG" "$TAG" |
| 60 | + done |
0 commit comments