From 8bca5b75b9806f764aaaec6262e64267f890c6d6 Mon Sep 17 00:00:00 2001 From: vinitha-balachandran Date: Fri, 1 Mar 2024 18:25:06 +0800 Subject: [PATCH] adding publish.yml file --- .github/workflows/publish.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..aa1d7abb --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: docs + +on: + workflow_dispatch: + push: + branches: [master] + tags: + - "*" + +jobs: + evaluate-label: + runs-on: ubuntu-latest + outputs: + label: ${{ steps.label_step.outputs.version}} + steps: + - name: checks for the label + id: label_step + run: | + if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "version=latest" >> $GITHUB_OUTPUT + fi + if [[ "${{ github.ref_type }}" == "branch" ]] && [[ "${{ github.ref }}" != "refs/heads/master" ]]; then + exit 1 + fi + if [[ "${{ github.ref_type }}" == "tag" ]]; then + echo "version=stable" >> $GITHUB_OUTPUT + fi + + deploy-docs: + needs: [evaluate-label] + uses: qiboteam/workflows/.github/workflows/deploy-ghpages-latest-stable.yml@main + with: + python-version: "3.10" + package-manager: "poetry" + dependency-path: "**/poetry.lock" + trigger-label: "${{needs.evaluate-label.outputs.label}}" + project: qibotn + poetry-extras: --with docs \ No newline at end of file