Build Docker API Proxy image #17
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 Docker API Proxy image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docker-api-proxy/**' | |
| - '!docker-api-proxy/README.md' | |
| - '!docker-api-proxy/examples/**' | |
| - '.github/workflows/build-docker-api-proxy.yml' | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '35 4 * * 6' # Every Saturday at 04:35am | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| version: ['0.1.0'] | |
| caddy_version: ['2.9.1'] | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push image to registry | |
| uses: docker/build-push-action@v5 | |
| with: | |
| platforms: linux/amd64 | |
| context: ./docker-api-proxy | |
| file: ./docker-api-proxy/Dockerfile | |
| push: true | |
| build-args: | | |
| CADDY_VERSION=${{ matrix.caddy_version }} | |
| tags: | | |
| ghcr.io/f-bn/docker-api-proxy:${{ matrix.version }} | |
| ghcr.io/f-bn/docker-api-proxy:latest |