π Spec: Updated the SPEC for API servers π #410
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: | |
| push: | |
| branches: ['**'] | |
| tags: | |
| - 'v*' | |
| - '*.*.*' | |
| workflow_dispatch: | |
| concurrency: | |
| group: docker-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/devel' && github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/beta' }} | |
| env: | |
| PROJECTNAME: search | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build: | |
| name: Build and push Docker image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set build info | |
| run: | | |
| echo "COMMIT_ID=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_ENV" | |
| echo "YYMM=$(date +"%y%m")" >> "$GITHUB_ENV" | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| echo "VERSION=${VERSION#v}" >> "$GITHUB_ENV" | |
| echo "IS_TAG=true" >> "$GITHUB_ENV" | |
| else | |
| echo "VERSION=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_ENV" | |
| echo "IS_TAG=false" >> "$GITHUB_ENV" | |
| fi | |
| EPOCH="$(date -u +%s)" | |
| echo "BUILD_EPOCH=${EPOCH}" >> "$GITHUB_ENV" | |
| echo "BUILD_DATE=$(date -u -d @"${EPOCH}" +"%Y-%m-%dT%H:%M:%SZ")" >> "$GITHUB_ENV" | |
| - name: Determine tags | |
| id: tags | |
| run: | | |
| PROD_TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }}" | |
| DEV_TAGS="" | |
| if [[ "${{ env.IS_TAG }}" == "true" ]]; then | |
| PROD_TAGS="$PROD_TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}" | |
| PROD_TAGS="$PROD_TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" | |
| PROD_TAGS="$PROD_TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.YYMM }}" | |
| else | |
| DEV_TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:devel" | |
| if [[ "${{ github.ref }}" == refs/heads/beta ]]; then | |
| DEV_TAGS="$DEV_TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:beta" | |
| fi | |
| fi | |
| echo "prod_tags=$PROD_TAGS" >> "$GITHUB_OUTPUT" | |
| echo "dev_tags=$DEV_TAGS" >> "$GITHUB_OUTPUT" | |
| - name: Build and push production image | |
| if: steps.tags.outputs.prod_tags != '' | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| provenance: false | |
| tags: ${{ steps.tags.outputs.prod_tags }} | |
| build-args: | | |
| VERSION=${{ env.VERSION }} | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| BUILD_EPOCH=${{ env.BUILD_EPOCH }} | |
| COMMIT_ID=${{ env.COMMIT_ID }} | |
| labels: | | |
| maintainer=casjay <casjay@yahoo.com> | |
| org.opencontainers.image.vendor=apimgr | |
| org.opencontainers.image.authors=apimgr | |
| org.opencontainers.image.title=${{ env.PROJECTNAME }} | |
| org.opencontainers.image.base.name=${{ env.PROJECTNAME }} | |
| org.opencontainers.image.description=Privacy-respecting self-hosted metasearch engine | |
| org.opencontainers.image.version=${{ env.VERSION }} | |
| org.opencontainers.image.schema-version=${{ env.VERSION }} | |
| org.opencontainers.image.created=${{ env.BUILD_DATE }} | |
| org.opencontainers.image.revision=${{ env.COMMIT_ID }} | |
| org.opencontainers.image.url=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.vcs-type=Git | |
| org.opencontainers.image.licenses=MIT | |
| com.github.containers.toolbox=false | |
| annotations: | | |
| manifest:maintainer=casjay <casjay@yahoo.com> | |
| manifest:org.opencontainers.image.vendor=apimgr | |
| manifest:org.opencontainers.image.authors=apimgr | |
| manifest:org.opencontainers.image.title=${{ env.PROJECTNAME }} | |
| manifest:org.opencontainers.image.description=Privacy-respecting self-hosted metasearch engine | |
| manifest:org.opencontainers.image.version=${{ env.VERSION }} | |
| manifest:org.opencontainers.image.schema-version=${{ env.VERSION }} | |
| manifest:org.opencontainers.image.created=${{ env.BUILD_DATE }} | |
| manifest:org.opencontainers.image.revision=${{ env.COMMIT_ID }} | |
| manifest:org.opencontainers.image.url=https://github.com/${{ github.repository }} | |
| manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| manifest:org.opencontainers.image.documentation=https://github.com/${{ github.repository }} | |
| manifest:org.opencontainers.image.vcs-type=Git | |
| manifest:org.opencontainers.image.licenses=MIT | |
| manifest:com.github.containers.toolbox=false | |
| - name: Build and push devel image | |
| if: steps.tags.outputs.dev_tags != '' | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: . | |
| file: docker/Dockerfile.dev | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| provenance: false | |
| tags: ${{ steps.tags.outputs.dev_tags }} | |
| build-args: | | |
| VERSION=${{ env.VERSION }} | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| BUILD_EPOCH=${{ env.BUILD_EPOCH }} | |
| COMMIT_ID=${{ env.COMMIT_ID }} | |
| labels: | | |
| maintainer=casjay <casjay@yahoo.com> | |
| org.opencontainers.image.vendor=apimgr | |
| org.opencontainers.image.authors=apimgr | |
| org.opencontainers.image.title=${{ env.PROJECTNAME }} | |
| org.opencontainers.image.base.name=${{ env.PROJECTNAME }} | |
| org.opencontainers.image.description=Privacy-respecting self-hosted metasearch engine | |
| org.opencontainers.image.version=${{ env.VERSION }} | |
| org.opencontainers.image.schema-version=${{ env.VERSION }} | |
| org.opencontainers.image.created=${{ env.BUILD_DATE }} | |
| org.opencontainers.image.revision=${{ env.COMMIT_ID }} | |
| org.opencontainers.image.url=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.documentation=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.vcs-type=Git | |
| org.opencontainers.image.licenses=MIT | |
| com.github.containers.toolbox=false | |
| annotations: | | |
| manifest:maintainer=casjay <casjay@yahoo.com> | |
| manifest:org.opencontainers.image.vendor=apimgr | |
| manifest:org.opencontainers.image.authors=apimgr | |
| manifest:org.opencontainers.image.title=${{ env.PROJECTNAME }} | |
| manifest:org.opencontainers.image.description=Privacy-respecting self-hosted metasearch engine | |
| manifest:org.opencontainers.image.version=${{ env.VERSION }} | |
| manifest:org.opencontainers.image.schema-version=${{ env.VERSION }} | |
| manifest:org.opencontainers.image.created=${{ env.BUILD_DATE }} | |
| manifest:org.opencontainers.image.revision=${{ env.COMMIT_ID }} | |
| manifest:org.opencontainers.image.url=https://github.com/${{ github.repository }} | |
| manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| manifest:org.opencontainers.image.documentation=https://github.com/${{ github.repository }} | |
| manifest:org.opencontainers.image.vcs-type=Git | |
| manifest:org.opencontainers.image.licenses=MIT | |
| manifest:com.github.containers.toolbox=false |