From 46bfa8479ca075305674c148762e61480b544205 Mon Sep 17 00:00:00 2001 From: Frank Harkins Date: Wed, 27 Sep 2023 14:30:44 +0100 Subject: [PATCH] Automatically publish tutorials to learning platform --- .github/workflows/deploy.yml | 17 ++++++++- .../workflows/push-tutorials-to-staging.yml | 36 +++++++++++++++++++ docs/tutorials/iql.conf.yaml | 25 +++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/push-tutorials-to-staging.yml create mode 100644 docs/tutorials/iql.conf.yaml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1acdafa99..4ff96e927 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,4 +36,19 @@ jobs: pip install -U twine pip setuptools virtualenv wheel python3 setup.py sdist bdist_wheel twine upload dist/qiskit* - shell: bash \ No newline at end of file + shell: bash + + publish-tutorials: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: Publish tutorials to learning.quantum-computing.ibm.com + env: + LEARNING_API_TOKEN: ${{ secrets.LEARNING_API_TOKEN_PRODUCTION }} + LEARNING_API_ENVIRONMENT: production + run: | + pip install git+https://github.com/frankharkins/learning-content-tools.git@7295b8441ee937119d22845de33dc62cac782ab2#subdirectory=iql-lesson-sync + cd docs/tutorials + sync-lessons diff --git a/.github/workflows/push-tutorials-to-staging.yml b/.github/workflows/push-tutorials-to-staging.yml new file mode 100644 index 000000000..195fe5937 --- /dev/null +++ b/.github/workflows/push-tutorials-to-staging.yml @@ -0,0 +1,36 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +name: Publish tutorials to staging website + +on: + push: + branches: + - "main" + +jobs: + publish-tutorials: + runs-on: ubuntu-latest + strategy: + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: Push tutorials to learning.www-dev.quantum-computing.ibm.com + env: + LEARNING_API_TOKEN: ${{ secrets.LEARNING_API_TOKEN_STAGING }} + LEARNING_API_ENVIRONMENT: staging + run: | + pip install git+https://github.com/frankharkins/learning-content-tools.git@7295b8441ee937119d22845de33dc62cac782ab2#subdirectory=iql-lesson-sync + cd docs/tutorials + sync-lessons diff --git a/docs/tutorials/iql.conf.yaml b/docs/tutorials/iql.conf.yaml new file mode 100644 index 000000000..8850118ff --- /dev/null +++ b/docs/tutorials/iql.conf.yaml @@ -0,0 +1,25 @@ +lessons: + - path: error-suppression-and-error-mitigation + idStaging: 7e6b09d2-58d5-4892-9c70-4a4d662acd22 + idProduction: fde8bbfe-d9ca-4afd-b0d5-8317568fd9e1 + - path: chsh-with-estimator + idStaging: 0229e597-ac0d-4641-98c8-cb9d6bf10617 + idProduction: d4861fee-1dc1-41b2-a5ba-671bc54b747b + - path: grover-with-sampler + idStaging: 9b9b8eec-549a-4f20-822d-c984d0ee7b3d + idProduction: 84dbbc7c-16b5-4aec-b142-9c349bf7a89b + - path: how-to-getting-started-with-estimator + idStaging: 7467fd2c-4a69-4b1b-bef7-b3efe068984e + idProduction: d8ee4662-7c6f-4446-a8a3-5fe79fa71c48 + - path: how-to-getting-started-with-sampler + idStaging: cadf4f4f-c662-434f-828b-e25dc48ee57e + idProduction: f0cc58e1-789f-4b57-b1b7-693b84b32290 + - path: qaoa-with-primitives + idStaging: 63dd4f57-dda7-4a07-a9f3-c6ea4560f214 + idProduction: 20ef1afa-e86f-414d-bb40-f8f1490d531c + - path: user-transpiled-circuits + idStaging: 7e6b09d2-58d5-4892-9c70-4a4d662acd22 + idProduction: 47dad7bd-4e08-4d22-a528-02d963df9e42 + - path: vqe-with-estimator + idStaging: d1059d99-95c8-41e5-ba7c-9f0827d479ce + idProduction: 62a189e9-44cc-482b-90e8-30a479f23bac