Env vars padrão das actions
URL sobre aqui: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
Workflows de exemplo
Gravar em .github/workflows
no repo.
Deploy com release tags
name: Release Workflow
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: 'Determine VERSION from tag'
id: 'version'
run: |
echo "value=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: 'Print version tag from version output'
run: |
echo "version=${{ steps.version.outputs.value }}"
Python c/ Poetry
name: Python Lint
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: Install dependencies
run: poetry install --with dev
- name: Run ruff lint
run: poetry run ruff lint .