Skip to content

Commit

Permalink
refactor gha
Browse files Browse the repository at this point in the history
  • Loading branch information
felix920506 committed Feb 27, 2025
1 parent 7f36d91 commit bc94cde
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
name: Build Docker Container
on: [workflow_dispatch]
jobs:
build-and-publish-amd64:
generate-requirements.txt:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
uses actions/checkout@v4

- name: setup Python
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install poetry

- name: install poetry
run: python3 -m pip install poetry
- name: Install poetry dependencies

- name: install poetry dependencies
run: poetry install

- name: export requirements.txt
run: poetry export -f requirements.txt --output requirements.txt
run: poetry export --without-hashes -f requirements.txt --output requirements.txt

- name: upload requirements.txt
uses: actions/upload-artifact@v3
with:
name: requirements
path: requirements.txt

build-and-publish-amd64:
runs-on: ubuntu-latest
needs: generate-requirements
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: debug
run: ls
- name: Download requirements.txt
uses: actions/download-artifact@v3
with:
name: requirements

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -42,26 +57,15 @@ jobs:

build-and-publish-arm64:
runs-on: ubuntu-24.04-arm
needs: generate-requirements
steps:
- name: checkout repo
- name: Checkout repo
uses: actions/checkout@v4

- name: setup Python
uses: actions/setup-python@v5
- name: Download requirements.txt
uses: actions/download-artifact@v3
with:
python-version: 3.12

- name: Install poetry
run: python3 -m pip install poetry

- name: Install poetry dependencies
run: poetry install

- name: export requirements.txt
run: poetry export -f requirements.txt --output requirements.txt

- name: debug
run: ls
name: requirements

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down

0 comments on commit bc94cde

Please sign in to comment.