Fix dashboard refresh and state tooltip #21
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: Build and Push Images | |
| "on": | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - image: tesla-dashboard-api | |
| context: ./backend | |
| file: ./backend/Dockerfile | |
| - image: tesla-dashboard-web | |
| context: ./frontend | |
| file: ./frontend/Dockerfile | |
| - image: tesla-dashboard-postgres | |
| context: ./deploy | |
| file: ./deploy/Dockerfile.postgres | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Aliyun Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.ALIYUN_REGISTRY }} | |
| username: ${{ secrets.ALIYUN_REGISTRY_USER }} | |
| password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }} | |
| - name: Prepare tags | |
| id: tags | |
| shell: bash | |
| env: | |
| REGISTRY: ${{ secrets.ALIYUN_REGISTRY }} | |
| NAMESPACE: ${{ secrets.ALIYUN_NAME_SPACE }} | |
| IMAGE: ${{ matrix.image }} | |
| run: | | |
| set -euo pipefail | |
| { | |
| echo "tags<<EOF" | |
| echo "${REGISTRY}/${NAMESPACE}/${IMAGE}:latest" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ${{ matrix.context }} | |
| file: ${{ matrix.file }} | |
| push: true | |
| platforms: linux/amd64 | |
| tags: ${{ steps.tags.outputs.tags }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| mirror-runtime-images: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - source: postgres:18-trixie | |
| image: postgres | |
| tag: 18-trixie | |
| - source: eclipse-mosquitto:2 | |
| image: eclipse-mosquitto | |
| tag: "2" | |
| - source: teslamate/teslamate:latest | |
| image: teslamate | |
| tag: latest | |
| steps: | |
| - name: Login to Aliyun Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.ALIYUN_REGISTRY }} | |
| username: ${{ secrets.ALIYUN_REGISTRY_USER }} | |
| password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }} | |
| - name: Mirror image | |
| shell: bash | |
| env: | |
| REGISTRY: ${{ secrets.ALIYUN_REGISTRY }} | |
| NAMESPACE: ${{ secrets.ALIYUN_NAME_SPACE }} | |
| SOURCE_IMAGE: ${{ matrix.source }} | |
| TARGET_IMAGE: ${{ matrix.image }} | |
| TARGET_TAG: ${{ matrix.tag }} | |
| run: | | |
| set -euo pipefail | |
| TARGET="${REGISTRY}/${NAMESPACE}/${TARGET_IMAGE}:${TARGET_TAG}" | |
| docker pull "${SOURCE_IMAGE}" | |
| docker tag "${SOURCE_IMAGE}" "${TARGET}" | |
| docker push "${TARGET}" |