name: Build on: push: branches: - main tags: - v*.*.* jobs: build: name: Build docker images. runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout repository. uses: actions/checkout@v3 with: submodules: true - name: Get version from tag. uses: little-core-labs/get-git-tag@v3.0.2 - name: Get build date/time. id: date run: echo "::set-output name=date::$(date -u --rfc-3339=seconds)" - name: Set up QEMU. id: qemu uses: docker/setup-qemu-action@v2 with: platforms: arm64 - name: Set up Docker Buildx. uses: docker/setup-buildx-action@v2 - name: Login to GHCR. uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Login to DockerHub. uses: docker/login-action@v2 with: username: latty password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Build and push uses: docker/bake-action@v2 with: files: "docker-bake.hcl" set: | "*.output=type=registry" env: VCS_REF: ${{ github.sha }} VERSION: ${{ env.GIT_TAG_NAME }} BUILD_DATE: ${{ steps.date.outputs.date }}