Build, test and push Docker images #188
This file contains 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, 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 |