GitHub Actions¶
Example workflow. This project’s own CI is GitLab; the CLI is the same.
name: eve-iac
on:
pull_request:
push:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install eve-iac --index-url https://gitlab.com/api/v4/projects/eve-ng-dev%2Feve-iac/packages/pypi/simple
- env:
EVE_IAC_URL: ${{ secrets.EVE_IAC_URL }}
EVE_IAC_TOKEN: ${{ secrets.EVE_IAC_TOKEN }}
EVE_IAC_CA_PEM: ${{ secrets.EVE_IAC_CA_PEM }}
run: |
eve-iac session
eve-iac validate ./IaC/spine-leaf
eve-iac plan ./IaC/spine-leaf --json
apply:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install eve-iac --index-url https://gitlab.com/api/v4/projects/eve-ng-dev%2Feve-iac/packages/pypi/simple
- env:
EVE_IAC_URL: ${{ secrets.EVE_IAC_URL }}
EVE_IAC_TOKEN: ${{ secrets.EVE_IAC_TOKEN }}
EVE_IAC_CA_PEM: ${{ secrets.EVE_IAC_CA_PEM }}
run: eve-iac reconcile ./IaC/spine-leaf --direction to_eve
Store the CA as EVE_IAC_CA_PEM or check in a public pin file and set EVE_IAC_CA_FILE.