name: Build and push Docker image to Container Registry on: push: branches: - main tags: - '*' jobs: build-and-push: name: Build and push Docker image to Container Registry runs-on: ubuntu-latest container: image: catthehacker/ubuntu:act-latest env: DOCKER_LATEST: latest RUNNER_TOOL_CACHE: /toolcache steps: - name: Checkout repository uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Container Registry uses: docker/login-action@v2 with: registry: git.depeuter.dev username: ${{ github.actor }} password: ${{ secrets.CI_TOKEN }} - name: Get Meta for frontend id: meta_frontend uses: docker/metadata-action@v5 with: images: git.depeuter.dev/${{ github.repository }}/frontend - name: Build and push frontend id: docker_build_frontend uses: docker/build-push-action@v4 with: context: ./frontend file: ./frontend/Dockerfile push: true tags: ${{ steps.meta_frontend.outputs.tags }} labels: ${{ steps.meta_frontend.outputs.labels }} - name: Get Meta for backend id: meta_backend uses: docker/metadata-action@v5 with: images: git.depeuter.dev/${{ github.repository }}/backend - name: Build and push backend id: docker_build_backend uses: docker/build-push-action@v4 with: context: ./backend file: ./backend/Dockerfile push: true tags: ${{ steps.meta_backend.outputs.tags }} labels: ${{ steps.meta_backend.outputs.labels }} - name: Frontend image digest run: echo ${{ steps.docker_build_frontend.outputs.digest }} - name: Backend image digest run: echo ${{ steps.docker_build_backend.outputs.digest }}