Merge pull request #1076 from PokeAPI/revert-openapi

CICD OpenAPI
This commit is contained in:
Alessandro Pezzè 2024-05-06 21:06:03 +02:00 committed by GitHub
commit 5575d2476a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 8 deletions

View file

@ -20,6 +20,9 @@ jobs:
- run:
name: Run tests
command: make test
- run:
name: Generate OpenAPI schema
command: make openapi-generate
build:
docker:
- image: cimg/python:3.10.9

View file

@ -35,7 +35,7 @@ jobs:
context: .
file: ./Resources/docker/app/Dockerfile
push: false
platforms: local
platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest

View file

@ -13,21 +13,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
pokeapi/pokeapi
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
@ -43,12 +43,12 @@ jobs:
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./Resources/docker/app/Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7,linux/arm/v6
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest

View file

@ -41,6 +41,9 @@ make-migrations: # Create migrations files if schema has changed
shell: # Load a shell
python manage.py shell ${local_config}
openapi-generate:
python manage.py spectacular --color --file openapi.yml ${local_config}
docker-up: # (Docker) Create services/volumes/networks
docker-compose up -d