2024-01-13 14:12:51 +00:00
|
|
|
name: Actions
|
2024-01-06 18:36:54 +00:00
|
|
|
on:
|
|
|
|
push:
|
2025-01-26 00:43:02 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2024-01-06 18:36:54 +00:00
|
|
|
pull_request:
|
2024-01-06 16:01:31 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-10-10 16:03:50 -04:00
|
|
|
lint:
|
|
|
|
name: Lint Code (Ruff & Pylint)
|
2024-01-13 14:12:51 +00:00
|
|
|
runs-on: docker
|
2025-03-29 13:31:15 +00:00
|
|
|
container: catthehacker/ubuntu:act-latest@sha256:01991645805fd6fff768097e03b3ab6dcc62ddddc9426206bad6068719dbb63f
|
2024-01-13 14:12:51 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2025-03-19 15:37:53 -04:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
2024-01-13 14:12:51 +00:00
|
|
|
|
2025-03-18 03:10:43 -05:00
|
|
|
- name: "Setup uv"
|
2025-03-31 00:41:12 +00:00
|
|
|
uses: actions/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
|
2025-03-18 03:10:43 -05:00
|
|
|
with:
|
|
|
|
version: "latest"
|
|
|
|
enable-cache: true
|
2025-03-18 03:47:03 -05:00
|
|
|
prune-cache: false
|
2025-03-18 03:40:24 -05:00
|
|
|
github-token: ${{ secrets.GITHUBTOKEN }}
|
2024-01-13 14:12:51 +00:00
|
|
|
|
2025-03-18 03:11:55 -05:00
|
|
|
- name: "Install dependencies"
|
|
|
|
run: uv sync
|
|
|
|
|
2024-02-14 10:35:57 -05:00
|
|
|
- name: Analysing code with Ruff
|
2025-03-18 03:57:07 -05:00
|
|
|
run: uv run ruff check $(git ls-files '*.py')
|
2024-02-28 11:30:04 -05:00
|
|
|
continue-on-error: true
|
2024-01-13 14:12:51 +00:00
|
|
|
|
2024-02-28 10:52:22 -05:00
|
|
|
- name: Analysing code with Pylint
|
2025-03-18 03:57:07 -05:00
|
|
|
run: uv run pylint --rcfile=.forgejo/workflows/config/.pylintrc $(git ls-files '*.py')
|
2024-02-28 10:52:22 -05:00
|
|
|
|
2024-10-10 16:03:50 -04:00
|
|
|
docs:
|
|
|
|
name: Build Documentation (MkDocs)
|
2024-01-06 16:01:31 +00:00
|
|
|
runs-on: docker
|
2025-03-29 13:31:15 +00:00
|
|
|
container: catthehacker/ubuntu:act-latest@sha256:01991645805fd6fff768097e03b3ab6dcc62ddddc9426206bad6068719dbb63f
|
2024-01-06 16:01:31 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2025-03-19 15:37:53 -04:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
2024-01-06 16:07:26 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-01-07 12:36:14 +00:00
|
|
|
|
2025-03-18 03:10:43 -05:00
|
|
|
- name: "Setup uv"
|
2025-03-31 00:41:12 +00:00
|
|
|
uses: actions/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
|
2025-03-18 03:10:43 -05:00
|
|
|
with:
|
|
|
|
version: "latest"
|
|
|
|
enable-cache: true
|
2025-03-18 03:47:03 -05:00
|
|
|
prune-cache: false
|
2025-03-18 03:40:24 -05:00
|
|
|
github-token: ${{ secrets.GITHUBTOKEN }}
|
2024-10-10 16:03:50 -04:00
|
|
|
|
2024-01-06 16:01:31 +00:00
|
|
|
- name: Install dependencies
|
2025-03-18 03:24:48 -05:00
|
|
|
run: uv sync --no-dev --group=documentation
|
2024-01-07 12:36:14 +00:00
|
|
|
|
2024-01-13 14:12:51 +00:00
|
|
|
- name: Set environment variables
|
2025-03-28 10:54:31 -04:00
|
|
|
uses: actions/env@1791216cd180e6578dd1d67fb8d2852b883a5f53 # v2
|
2024-01-07 12:49:44 +00:00
|
|
|
|
2024-01-13 14:12:51 +00:00
|
|
|
- name: Build documentation
|
|
|
|
run: |
|
|
|
|
export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.seacogs.coastalcommits.com"
|
|
|
|
export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/.docs"
|
2025-03-18 03:57:07 -05:00
|
|
|
uv run mkdocs build -v
|
2024-01-13 14:12:51 +00:00
|
|
|
|
|
|
|
- name: Deploy documentation
|
2024-01-06 16:01:31 +00:00
|
|
|
run: |
|
2024-01-07 02:33:58 +00:00
|
|
|
GREEN='\033[0;32m'
|
|
|
|
YELLOW='\033[0;33m'
|
|
|
|
BLUE='\033[0;34m'
|
|
|
|
|
2024-01-07 02:25:18 +00:00
|
|
|
unset GITHUB_TOKEN
|
|
|
|
unset GITLAB_TOKEN
|
2024-01-07 02:33:58 +00:00
|
|
|
|
2024-06-11 16:50:15 -04:00
|
|
|
echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n"
|
2024-01-06 22:04:36 +00:00
|
|
|
|
2024-01-06 19:19:34 +00:00
|
|
|
npx -p "@getmeli/cli" meli upload ./site \
|
2025-03-19 08:05:09 -04:00
|
|
|
--url "https://meli.csw.im" \
|
2024-01-06 22:02:30 +00:00
|
|
|
--site "${{ vars.MELI_SITE_ID }}" \
|
2024-10-21 16:53:28 -04:00
|
|
|
--token "${{ secrets.MELI_TOKEN }}" \
|
2024-01-07 12:53:32 +00:00
|
|
|
--release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" \
|
2024-01-07 12:49:44 +00:00
|
|
|
--branch "$CI_ACTION_REF_NAME_SLUG"
|
2024-01-06 22:04:36 +00:00
|
|
|
|
2024-06-11 16:50:15 -04:00
|
|
|
echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}!"
|
2025-03-28 10:25:01 -05:00
|
|
|
echo "${GREEN}https://$CI_ACTION_REF_NAME_SLUG.seacogs.csw.im/"
|
2024-01-07 02:25:18 +00:00
|
|
|
env:
|
|
|
|
GITEA_TOKEN: ${{ secrets.COASTALCOMMITSTOKEN }}
|