https://github.com/extrange/actions
Common Github actions across projects
https://github.com/extrange/actions
Last synced: 5 months ago
JSON representation
Common Github actions across projects
- Host: GitHub
- URL: https://github.com/extrange/actions
- Owner: extrange
- Created: 2025-07-18T00:49:17.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-08-06T17:30:42.000Z (6 months ago)
- Last Synced: 2025-08-06T19:24:27.298Z (6 months ago)
- Language: Nix
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Reusable Github Actions
`devenv-test.yml`: Run all pre-commit hooks via [devenv].
```yaml
# .github/workflows/lint-and-test.yml
name: Lint and Test
on:
push:
branches:
- main
paths-ignore:
- "**.md"
jobs:
devenv-test:
uses: extrange/actions/.github/workflows/devenv-test.yml@v1.6
```
`devenv-update.yml`: Update the [devenv] environment.
```yaml
# .github/workflows/devenv-update.yml
name: "Update devenv and flake lockfile"
on:
workflow_dispatch:
schedule:
- cron: "0 17 * * *" # Runs daily at 01:00 SGT
jobs:
devenv-update:
uses: extrange/actions/.github/workflows/devenv-update.yml@v1.6
# Nested workflows can only have as much access as the caller workflow.
# https://docs.github.com/en/actions/reference/workflows-and-actions/reusable-workflows#access-and-permissions-for-nested-workflows
permissions:
contents: write
```
`build.yml`: Builds a Dockerfile (or a stage of it), caching via AWS ECR. Optionally, pushes the built image to ECR.
```yaml
# .github/workflows/build-and-deploy.yml
name: Build, Push to ECR and Deploy to `dev` K8S Cluster
on:
push:
branches:
- main
paths-ignore:
- "**.md"
permissions:
contents: write
id-token: write
jobs:
get-commit-metadata:
uses: extrange/actions/.github/workflows/commit-metadata.yml@v1.6
build:
uses: extrange/actions/.github/workflows/build.yml@v1.6
needs: get-commit-metadata
with:
ecr_repository: chatbot/russell-gpt-web # Change this
target: deployment
push: true
iam_role: ${{ vars.IAM_ROLE }}
aws_region: ${{ vars.AWS_REGION }}
build_args: |
COMMIT_SHA=${{ needs.get-commit-metadata.outputs.sha_short }}
COMMIT_TIMESTAMP=${{ needs.get-commit-metadata.outputs.timestamp }}
# You can add extra tags, e.g. the name of a pushed tag
extra_tags: |
${{ github.ref_name }}
```
## Notes
- Naming convention: `${language}-${workflow-name}`.
- For actions applicable to all languages, omit `${language}`.
- The Github Free plan [doesn't support] organization-level secrets and variables in private repositories.
- Called workflows only see the caller workflow repository's variables and secrets.
- Environment variables set in the `env` context, defined in the called workflow, are [not accessible] in the `env` context of the caller workflow. Use `vars` instead.
- Workflow files cannot [be in folders].
[doesn't support]: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-an-organization
[be in folders]: https://github.com/orgs/community/discussions/10773
[not accessible]: https://docs.github.com/en/actions/sharing-automations/reusing-workflows#limitations
[devenv]: https://devenv.sh