updated readme for verify-token and refresh-token #351
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: | |
push: | |
branches: | |
- feature/* | |
- fix/* | |
- refactor/* | |
- chore/* | |
- develop | |
jobs: | |
lint-project: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
. venv/bin/activate | |
python -m pip install --upgrade pip | |
pip install setuptools==58.0.4 wheel | |
pip install -r requirements.txt | |
pip install flake8 | |
- name: Create flake8 configuration file | |
run: | | |
echo "[flake8]" > .flake8 | |
echo "exclude = venv/*" >> .flake8 | |
echo "max-line-length = 99" >> .flake8 | |
- name: Verify installed packages | |
run: | | |
. venv/bin/activate | |
pip check | |
- name: Run linters | |
run: | | |
. venv/bin/activate | |
flake8 . | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run-tests: | |
needs: lint-project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
. venv/bin/activate | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
. venv/bin/activate | |
pytest --maxfail=1 --disable-warnings | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-test-image: | |
needs: run-tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: abbastoof | |
password: ${{ secrets.GH_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
merge-develop: | |
runs-on: ubuntu-latest | |
needs: publish-test-image | |
if: github.ref_name == 'develop' | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Fetch all branches | |
run: git fetch --all | |
- name: Merge branches into develop | |
run: | | |
git checkout develop | |
git merge --no-ff ${{ github.ref_name }} | |
git push origin develop |