InvenTree/.github/workflows/docker_latest.yaml
Oliver ea3133be1d Combine docker-build and docker-test CI steps
- We are building anyway, may as well test
2022-05-18 15:11:37 +10:00

54 lines
1.4 KiB
YAML

# Build and push latest docker image on push to master branch
name: Docker Build
on:
push:
branches:
- 'master'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Check version number
run: |
python3 ci/check_version_number.py --dev
- name: Build Docker Image
run: |
cd docker
docker-compose build
docker-compose run inventree-dev-server invoke update
docker-compose up -d
- name: Wait for Server
run: |
cd docker
docker-compose run inventree-dev-server invoke wait
- name: Run unit tests
run: |
cd docker
docker-compose run inventree-dev-server invoke test
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: ./docker
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
target: production
tags: inventree/inventree:latest
- name: Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}