Feat/server booster #29
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: Release Docker Image | |
| on: | |
| push: | |
| tags: [ 'v*' ] | |
| workflow_dispatch: {} | |
| pull_request: | |
| types: [ closed ] | |
| branches: [ main ] | |
| jobs: | |
| build-and-push: | |
| if: > | |
| github.event_name == 'push' || | |
| (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU (for multi-arch) | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set tag | |
| id: tag | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
| echo "IMAGE_TAG=${{ secrets.DOCKERHUB_USERNAME }}/aksaria:${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| else | |
| echo "TAG=latest" >> $GITHUB_ENV | |
| echo "IMAGE_TAG=${{ secrets.DOCKERHUB_USERNAME }}/aksaria:latest" >> $GITHUB_ENV | |
| fi | |
| - name: Build and push Docker image 🚀 | |
| run: | | |
| make release-multiarch TAG="$TAG" | |
| env: | |
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | |
| DOCKER_BUILDKIT: "1" |