-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from beeldengeluid/gh-actions
GH Actions
- Loading branch information
Showing
6 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Deploy dane-visual-feature-extraction-worker to ghcr | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=raw,value=edge,enable={{is_default_branch}} | ||
type=sha | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
labels: ${{ steps.meta.outputs.labels }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout Repository" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Python" | ||
uses: "actions/setup-python@v4" | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: "Install poetry" | ||
run: "pip install --user poetry" | ||
|
||
- name: "Install dev environment" | ||
run: poetry install --no-interaction --no-ansi | ||
|
||
### COMMENTED FOR NOW UNTIL WE START WITH TESTING | ||
# - name: "pytest" | ||
# run: | | ||
# cp config/config.yml config.yml | ||
# poetry run pytest -k 'not test_extract_features and not test_batches' | ||
|
||
- name: "flake8" | ||
run: "poetry run flake8" | ||
|
||
- name: "black" | ||
run: "poetry run black --check ." | ||
|
||
- name: "mypy" | ||
run: "poetry run mypy ." |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: main branch - test; deploy (ecr, tst, acc, aws) | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths-ignore: | ||
- README.md | ||
- LICENSE | ||
- docker-compose.yml | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/_test.yml | ||
|
||
### TO BE UNCOMMENTED ONCE DOCKER IS SET UP | ||
# deploy: | ||
# uses: ./.github/workflows/_deploy.yml | ||
# permissions: | ||
# contents: read | ||
# packages: write | ||
# needs: [test] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Manual deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/_test.yml | ||
|
||
### TO BE UNCOMMENTED ONCE DOCKER IS SET UP | ||
# deploy: | ||
# uses: ./.github/workflows/_deploy.yml | ||
# permissions: | ||
# contents: read | ||
# packages: write | ||
# needs: [test] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: All branches but main - test only | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "main" | ||
paths-ignore: | ||
- README.md | ||
- LICENSE | ||
- docker-compose.yml | ||
|
||
jobs: | ||
test: | ||
uses: "./.github/workflows/_test.yml" |
Empty file.