name: Test via test action and then build image on: push: branches: - main - develop jobs: unit-test: container: image: node:16-buster-slim steps: - name: Checkout uses: actions/checkout@v4 - name: Run test job uses: ./.gitea/workflows/test.yaml build: container: image: node:16-buster-slim needs: unit-test steps: - name: Checkout uses: actions/checkout@v4 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: # list of Docker images to use as base name for tags images: | fedi-image-bot/bot-api git.fai.st/fedi-image-bot/bot-api # generate Docker tags based on the following events/attributes tags: | type=schedule type=ref,event=branch type=ref,event=pr type=sha - name: Set up QEMU # Add support for more platforms with QEMU (optional) # https://github.com/docker/setup-qemu-action uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to fai.st docker registry uses: docker/login-action@v3 with: registry: git.fai.st username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Build and push uses: docker/build-push-action@v5 with: platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=fedi-image-bot/bot-api:latest cache-to: type=inline