Twilight 0.17 upgrade #95
Workflow file for this run
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: Docker build | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - trunk | |
| jobs: | |
| build-images: | |
| name: Build Docker Images | |
| strategy: | |
| matrix: | |
| include: | |
| - tag: amd64 | |
| features: "" | |
| image: ubuntu-latest | |
| - tag: metrics-amd64 | |
| features: metrics | |
| image: ubuntu-latest | |
| - tag: armv8 | |
| features: "" | |
| image: ubuntu-24.04-arm | |
| - tag: metrics-armv8 | |
| features: metrics | |
| image: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.image }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v3 | |
| - name: Login to ghcr | |
| if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request' | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io | |
| - name: Convert GITHUB_REPOSITORY into lowercase | |
| run: | | |
| echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
| - name: Build ${{ matrix.tag }} | |
| run: | | |
| podman build \ | |
| --format docker \ | |
| --build-arg FEATURES=${{ matrix.features }} \ | |
| -t http-proxy:${{ matrix.tag }} \ | |
| . | |
| - name: Push image | |
| if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request' | |
| run: | | |
| podman tag http-proxy:${{ matrix.tag }} ghcr.io/${REPO}:${{ matrix.tag }} | |
| podman push ghcr.io/${REPO}:${{ matrix.tag }} | |
| create-manifest: | |
| name: Create Docker manifests | |
| runs-on: ubuntu-latest | |
| needs: build-images | |
| if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request' | |
| steps: | |
| - name: Login to ghcr | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io | |
| - name: Convert GITHUB_REPOSITORY into lowercase | |
| run: | | |
| echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
| - name: Create manifest and push it | |
| run: | | |
| podman manifest create http-proxy-latest docker://ghcr.io/${REPO}:amd64 docker://ghcr.io/${REPO}:armv8 | |
| podman manifest create http-proxy-metrics docker://ghcr.io/${REPO}:metrics-amd64 docker://ghcr.io/${REPO}:metrics-armv8 | |
| podman manifest push --format v2s2 http-proxy-latest docker://ghcr.io/${REPO}:latest | |
| podman manifest push --format v2s2 http-proxy-metrics docker://ghcr.io/${REPO}:metrics |