CD #139
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: CD | |
| on: | |
| workflow_run: | |
| workflows: ["CI"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: reluster | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🏗️ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 🔐 Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 🏗️ Build & Push HA Images | |
| run: | | |
| docker compose -f docker-compose.ha.yml build --progress=plain | |
| docker tag thuongtruong1009/${{ env.IMAGE_NAME }}-replica:latest \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}/ha-replica:latest | |
| docker tag thuongtruong1009/${{ env.IMAGE_NAME }}-sentinel:latest \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}/ha-sentinel:latest | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}/ha-replica:latest | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}/ha-sentinel:latest | |
| - name: 🏗️ Build & Push Cluster Image | |
| run: | | |
| docker compose -f docker-compose.cluster.yml build --progress=plain | |
| docker tag thuongtruong1009/${{ env.IMAGE_NAME }}:latest \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}:latest | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}:latest | |
| - name: 🏗️ Build & Push Cluster Benchmark Image | |
| run: | | |
| docker build -f configs/cluster/Dockerfile.bench -t thuongtruong1009/${{ env.IMAGE_NAME }}-bench:latest . | |
| docker tag thuongtruong1009/${{ env.IMAGE_NAME }}-bench:latest \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}-bench:latest | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}-bench:latest |