InvenTree/.github/workflows/docker_latest.yaml

52 lines
1.4 KiB
YAML
Raw Normal View History

2021-04-21 01:13:37 +00:00
# Build and push latest docker image on push to master branch
2021-03-31 11:45:42 +00:00
2021-04-21 01:13:37 +00:00
name: Docker Build
2021-03-31 11:45:42 +00:00
2021-04-21 01:13:37 +00:00
on:
push:
branches:
- 'master'
2021-03-31 11:45:42 +00:00
jobs:
2021-05-06 12:38:13 +00:00
2021-04-10 12:48:23 +00:00
docker:
2021-03-31 11:48:58 +00:00
runs-on: ubuntu-latest
2021-03-31 11:45:42 +00:00
steps:
2021-04-21 01:13:37 +00:00
- 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
- name: Run unit tests
run: |
cd docker
2022-05-18 05:39:58 +00:00
docker-compose up -d
docker-compose run inventree-dev-server invoke wait
docker-compose run inventree-dev-server invoke test
2022-05-18 05:12:19 +00:00
docker-compose down
2021-04-22 16:43:36 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-04-21 01:13:37 +00:00
- 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
2021-04-23 07:29:24 +00:00
platforms: linux/amd64,linux/arm64,linux/arm/v7
2021-04-21 01:13:37 +00:00
push: true
target: production
2021-04-21 01:13:37 +00:00
tags: inventree/inventree:latest
- name: Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}