Skip to content

Continuous Deployment #73

Continuous Deployment

Continuous Deployment #73

Workflow file for this run

name: "Continuous Deployment"
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: "${{ vars.PRIMARY_PYTHON_VERSION }}"
poetry-version: "${{ vars.POETRY_VERSION }}"
- name: Install Task
run: |
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- name: Install the library
run: poetry install --no-interaction --only-root
- name: Run Continuous Integration checks
run: poetry run task ci-checks
- name: Publish package
run: |
# Use GitHub's run_number as a post-release version identifier
if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.ref }}" == 'refs/heads/main' ]]; then
POETRY_VERSION=$(poetry version | awk '{print $2}')
NEW_VERSION="${POETRY_VERSION}.post${{ github.run_number }}"
poetry version "${NEW_VERSION}"
fi
poetry build
poetry publish --username __token__ --password ${{ secrets.PUBLIC_PYPI_API_TOKEN }}
- name: Initiate Website Deployment
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.CI_CD_TRIGGER_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
"https://api.github.com/repos/alphanome-ai/sec-parser-output-visualizer/dispatches" \
--data '{"event_type": "trigger-ci-cd"}'