Skip to content

Merge branch 'master' into mvc #3029

Merge branch 'master' into mvc

Merge branch 'master' into mvc #3029

Workflow file for this run

# A single CI script with github workflow
name: Build wheels and deploy
on:
workflow_dispatch:
push:
merge_group:
release:
types:
- published
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ 3.8, 3.9, '3.10', '3.11']
uses: qiboteam/workflows/.github/workflows/deploy-pip-poetry.yml@main
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
publish: ${{ github.event_name == 'release' && github.event.action == 'published' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }}
poetry-extras: "--with tests,docs"
secrets: inherit
deploy-docker-image:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Build docker image and upload to ghcr
run: |
IMAGE_NAME=qibo
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
docker build . --file docker/dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION