-
Notifications
You must be signed in to change notification settings - Fork 21
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
lAmeR1
committed
May 1, 2024
1 parent
9179846
commit 675a1da
Showing
1 changed file
with
27 additions
and
24 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 |
---|---|---|
@@ -1,35 +1,38 @@ | ||
name: Python App Workflow | ||
name: Docker Image TESTBUILD | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
arch: [ amd64, arm64 ] | ||
os: [ubuntu-latest] | ||
arch: [amd64, arm64] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU (for ARM64 emulation) | ||
if: matrix.arch == 'arm64' | ||
run: | | ||
sudo apt-get install -y qemu-user-static | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install pipenv | ||
pipenv install --dev --deploy | ||
- name: Build and run the application | ||
run: | | ||
pipenv run gunicorn -b 0.0.0.0:8000 -w 1 -k uvicorn.workers.UvicornWorker main:app --timeout 120 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: lamer1 | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Set up QEMU (for ARM64 emulation) | ||
if: matrix.arch == 'arm64' | ||
run: | | ||
sudo apt-get install -y qemu-user-static | ||
- name: Set up Docker Buildx (for multi-platform builds) | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build and push Docker image | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64 \ | ||
-t supertypo/kaspa-rest-server:branchtest \ | ||
--push . | ||
docker buildx imagetools inspect supertypo/kaspa-rest-server:branchtest |