refactor: refactor the proxy #14
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 Image CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: [ "v*.*.*" ] | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-push-images: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Unshallow | |
| run: git fetch --prune --unshallow | |
| - name: Get Tag | |
| id: tagger | |
| run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT | |
| - name: Docker meta for GHCR | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: | | |
| ghcr.io/risingwavelabs/promproxy | |
| tags: | | |
| type=semver,pattern=v{{version}} | |
| type=semver,pattern=v{{major}}.{{minor}} | |
| type=semver,pattern=v{{major}} | |
| type=sha | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - 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@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Push | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| build-args: | | |
| VERSION=${{steps.tagger.outputs.tag}} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| platforms: linux/amd64,linux/arm64 | |
| tags: "${{ steps.meta.outputs.tags }}" | |
| labels: ${{ steps.meta.outputs.labels }} |