π Spec: Updated the SPEC for API servers π #84
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: ${{ github.event.repository.name }} | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-standard: | |
| 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 | |
| env: | |
| GH_REF: ${{ github.ref }} | |
| run: | | |
| echo "COMMIT_ID=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| echo "YYMM=$(date +"%y%m")" >> $GITHUB_ENV | |
| if [[ "$GH_REF" == refs/tags/* ]]; then | |
| VERSION="${GH_REF#refs/tags/}" | |
| echo "VERSION=${VERSION#v}" >> $GITHUB_ENV | |
| echo "IS_TAG=true" >> $GITHUB_ENV | |
| else | |
| echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| echo "IS_TAG=false" >> $GITHUB_ENV | |
| fi | |
| echo "BUILD_DATE=$(date +"%a %b %d, %Y at %H:%M:%S %Z")" >> $GITHUB_ENV | |
| - name: Determine tags | |
| id: tags | |
| env: | |
| GH_REF: ${{ github.ref }} | |
| REGISTRY: ${{ env.REGISTRY }} | |
| IMAGE_NAME: ${{ env.IMAGE_NAME }} | |
| run: | | |
| TAGS="${REGISTRY}/${IMAGE_NAME}:${{ env.COMMIT_ID }}" | |
| if [[ "${{ env.IS_TAG }}" == "true" ]]; then | |
| TAGS="$TAGS,${REGISTRY}/${IMAGE_NAME}:${{ env.VERSION }}" | |
| TAGS="$TAGS,${REGISTRY}/${IMAGE_NAME}:latest" | |
| TAGS="$TAGS,${REGISTRY}/${IMAGE_NAME}:${{ env.YYMM }}" | |
| else | |
| TAGS="$TAGS,${REGISTRY}/${IMAGE_NAME}:devel" | |
| if [[ "$GH_REF" == refs/heads/beta ]]; then | |
| TAGS="$TAGS,${REGISTRY}/${IMAGE_NAME}:beta" | |
| fi | |
| fi | |
| echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
| - name: Build and push | |
| 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.tags }} | |
| build-args: | | |
| VERSION=${{ env.VERSION }} | |
| BUILD_DATE=${{ env.BUILD_DATE }} | |
| COMMIT_ID=${{ env.COMMIT_ID }} | |
| labels: | | |
| 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=${{ env.PROJECTNAME }} - standard image (alpine) | |
| org.opencontainers.image.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.licenses=MIT | |
| annotations: | | |
| manifest:org.opencontainers.image.vendor=apimgr | |
| manifest:org.opencontainers.image.authors=apimgr | |
| manifest:org.opencontainers.image.title=${{ env.PROJECTNAME }} | |
| manifest:org.opencontainers.image.base.name=${{ env.PROJECTNAME }} | |
| manifest:org.opencontainers.image.description=${{ env.PROJECTNAME }} - standard image (alpine) | |
| manifest:org.opencontainers.image.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.licenses=MIT |