Skip to content

Build, test and push Docker images #188

Build, test and push Docker images

Build, test and push Docker images #188

name: Build, test and push Docker images
on:
push:
paths-ignore:
- '**.md'
schedule:
- cron: '0 13 * * 0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build amd64 image
run: |
docker buildx bake amd64 --load
- uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Test amd64 image
run: |
docker compose up --no-build --pull never -d
sleep 5s
npx rest-cli calls.http --show headers
docker compose down
- name: Build all images
run: |
docker buildx bake
- name: Release images to Dockerhub
if: github.ref == 'refs/heads/master'
run: |
docker buildx bake --push