chore: update dependencies to latest versions #371
This file contains hidden or 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: ToC Sinopac Python CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11.9" | |
- name: Lint | |
run: | | |
make venv | |
source venv/bin/activate | |
make install | |
make lint | |
Build: | |
needs: Lint | |
env: | |
REPOSITORY: "${{ github.repository }}" | |
SHA: "${{ github.sha }}" | |
OWNER: "${{ github.repository_owner }}" | |
runs-on: ubuntu-latest | |
steps: | |
- name: set local env | |
run: | | |
LC_REPO_NAME=${REPOSITORY,,} | |
LC_USER_NAME=${OWNER,,} | |
echo "REPOSITORY_LC=$LC_REPO_NAME" >> ${GITHUB_ENV} | |
echo "SHORT_SHA=$(echo ${SHA} | cut -c1-7)" >> ${GITHUB_ENV} | |
echo "REPOSITORY_NAME_ONLY="${LC_REPO_NAME/"${LC_USER_NAME}/"/""}"" >> ${GITHUB_ENV} | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: log in to the github registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: log in to the docker hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: build and push to registry | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:${{ env.SHORT_SHA }} | |
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:latest | |
${{ secrets.DOCKER_USERNAME }}/${{ env.REPOSITORY_NAME_ONLY }}:${{ env.SHORT_SHA }} | |
${{ secrets.DOCKER_USERNAME }}/${{ env.REPOSITORY_NAME_ONLY }}:latest |