diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index e76f875..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,66 +0,0 @@ -version: 2.1 - -orbs: - node: circleci/node@7.2.1 - python: circleci/python@4.0.0 - -jobs: - build: - executor: - name: python/default - tag: "3.14" - steps: - - checkout - - python/install-packages: - pkg-manager: pip - - run: - command: mkdocs build - name: Build docs - - run: - command: scripts/create-api.py > site/api.json - name: Create API - - persist_to_workspace: - root: site - paths: - - ./ - - docs-deploy: - executor: - name: node/default - tag: "26.5" - steps: - - checkout - - attach_workspace: - at: site - - run: - name: Disable jekyll builds - command: touch site/.nojekyll - - run: - name: Dummy CircleCI config - command: | - mkdir site/.circleci - echo -e 'jobs:\n build:\n steps:\n -run: echo' > site/.circleci/config.yml - - run: - name: Install and configure dependencies - command: | - npm install -g --prefix=$HOME/.local --silent gh-pages@2.0.1 - git config user.email "ci-build@mozilla.com" - git config user.name "ci-build" - - add_ssh_keys: - fingerprints: - - "77:9a:db:a9:7d:e5:4e:b7:76:da:58:7b:a0:73:18:ae" - - run: - name: Deploy site to gh-pages branch - command: gh-pages --dotfiles --message "[ci skip] Updates" --dist site - -workflows: - build: - jobs: - - build - - docs-deploy: - requires: - - build - filters: - branches: - only: - - main diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..97cc7b9 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,55 @@ +name: "Test & Deploy" + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: '3.14' + cache: 'pip' + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Build docs + run: | + mkdocs build + + - name: Create API + run: | + ./scripts/create-api.py > site/api.json + + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 + with: + path: site + + deploy: + needs: build + permissions: + pages: write + id-token: write + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0