Skip to content

Regenerate qiskit API docs #3092

Regenerate qiskit API docs

Regenerate qiskit API docs #3092

Workflow file for this run

# This code is a Qiskit project.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE 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.
# This Action builds the docs in pull requests so that we can view a live preview.
# It uses IBM Cloud to build the Dockerfile at the root of the repository.
#
# Due to security, this can only run on branches of qiskit/docs, i.e. not on forks.
# We skip the actions if running on a fork.
name: Preview
on:
pull_request:
types: [opened, reopened, synchronize, closed]
paths:
- "docs/**/*"
- "public/images/**/*"
jobs:
setup:
if: |
(github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize') &&
github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/code-engine-preview.yml
with:
env_name: Preview
secrets:
ibmcloud_account: ${{ secrets.IBMCLOUD_ACCOUNT }}
ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
teardown:
if: |
github.event.action == 'closed' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Set PREVIEW_TAG
run: echo "PREVIEW_TAG=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
- name: Set APP_NAME and DOCKER_IMAGE_TAG
run: |
echo "APP_NAME=qiskit-docs-preview-${{ env.PREVIEW_TAG }}" >> $GITHUB_ENV
echo "DOCKER_IMAGE_TAG=icr.io/community-digital/qiskit-docs-preview:${{ env.PREVIEW_TAG }}" >> $GITHUB_ENV
- name: Install IBM Cloud CLI
run: |
curl -o IBM_Cloud_CLI_2.20.0_amd64.tar.gz -L https://download.clis.cloud.ibm.com/ibm-cloud-cli/2.20.0/IBM_Cloud_CLI_2.20.0_amd64.tar.gz
tar xvf IBM_Cloud_CLI_2.20.0_amd64.tar.gz
sh Bluemix_CLI/install
ibmcloud --version
ibmcloud config --check-version=false
ibmcloud plugin install -f code-engine
ibmcloud plugin install -f container-registry
- name: Authenticate with IBM Cloud CLI
run: |
ibmcloud login -g "Quantum Community" -r "us-south" -c "${{ secrets.ibmcloud_account }}" --apikey "${{ secrets.ibmcloud_api_key }}"
- name: Remove Code Engine preview application
run: |
ibmcloud ce project select -n qiskit-docs-preview
ibmcloud ce application delete \
--name "${{ env.APP_NAME }}" \
--wait \
--ignore-not-found \
--force
- name: Remove Docker image
run: |
ibmcloud cr region-set global
ibmcloud cr image-rm "${{ env.DOCKER_IMAGE_TAG }}"