-
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.
- Loading branch information
1 parent
bd3dd72
commit debde86
Showing
5 changed files
with
127 additions
and
129 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,63 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image_tag: | ||
type: string | ||
required: true | ||
ghcr_username: | ||
type: string | ||
required: true | ||
ghcr_image_name: | ||
type: string | ||
required: true | ||
secrets: | ||
ghcr_token: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache Docker Layers | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.ghcr_username }} | ||
password: ${{ secrets.ghcr_token }} | ||
|
||
- name: Build & Push Docker Image | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
env: | ||
GHCR_IMAGE: ghcr.io/${{ inputs.ghcr_image_name }} | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.GHCR_IMAGE }}:${{ inputs.image_tag }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
platforms: linux/amd64,linux/arm64/v8 | ||
|
||
- name: Image Digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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,27 @@ | ||
name: Run Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
cache: pip | ||
|
||
- name: Install Dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run Tests | ||
run: pytest 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: On Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
uses: ./.github/workflows/callable-test.yml |
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,23 @@ | ||
name: On Push (Main) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
uses: ./.github/workflows/callable-test.yml | ||
|
||
build: | ||
name: Build Docker Image | ||
uses: ./.github/workflows/callable-build.yml | ||
needs: | ||
- test | ||
with: | ||
ghcr_username: ${{ github.actor }} | ||
ghcr_image_name: ${{ github.repository }} | ||
image_tag: latest | ||
secrets: | ||
ghcr_token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.