Skip to content

Commit 4d6db53

Browse files
committed
fixes
1 parent 6f8a1fc commit 4d6db53

File tree

1 file changed

+68
-15
lines changed

1 file changed

+68
-15
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,77 @@ jobs:
3939
- name: Lint & Format (Ruff)
4040
run: rye run ruff check .
4141

42+
# - name: Log in to GHCR
43+
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
44+
45+
# - name: Build container
46+
# run: |
47+
# IMAGE_NAME=ghcr.io/query-farm/python-airport-test-server
48+
# docker build -t $IMAGE_NAME:latest .
49+
50+
# - name: Start server container
51+
# run: |
52+
# IMAGE_NAME=ghcr.io/query-farm/python-airport-test-server
53+
# docker run -d --name airport_test_server -p 50003:50003 $IMAGE_NAME:latest
54+
55+
# - name: Stop server
56+
# run: |
57+
# docker stop airport_test_server
58+
59+
# - name: Push Docker image to GHCR
60+
# run: |
61+
# IMAGE_NAME=ghcr.io/query-farm/python-airport-test-server
62+
# docker push $IMAGE_NAME:latest
63+
64+
# Build Linux images on ubuntu runner
65+
build-linux:
66+
needs: test
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: read
70+
packages: write
71+
steps:
72+
- uses: actions/checkout@v3
73+
74+
- name: Set up QEMU
75+
uses: docker/setup-qemu-action@v2
76+
77+
- name: Set up Docker Buildx
78+
uses: docker/setup-buildx-action@v2
79+
4280
- name: Log in to GHCR
43-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
81+
uses: docker/login-action@v2
82+
with:
83+
registry: ghcr.io
84+
username: ${{ github.actor }}
85+
password: ${{ secrets.GITHUB_TOKEN }}
4486

45-
- name: Build container
46-
run: |
47-
IMAGE_NAME=ghcr.io/query-farm/python-airport-test-server
48-
docker build -t $IMAGE_NAME:latest .
87+
- name: Build and push Linux images (amd64 + arm64)
88+
uses: docker/build-push-action@v4
89+
with:
90+
context: .
91+
push: true
92+
tags: ghcr.io/query-farm/python-airport-test-server:latest
93+
platforms: linux/amd64,linux/arm64
4994

50-
- name: Start server container
51-
run: |
52-
IMAGE_NAME=ghcr.io/query-farm/python-airport-test-server
53-
docker run -d --name airport_test_server -p 50003:50003 $IMAGE_NAME:latest
95+
# Build Windows image on windows runner
96+
build-windows:
97+
needs: test
98+
runs-on: windows-latest
99+
permissions:
100+
contents: read
101+
packages: write
102+
steps:
103+
- uses: actions/checkout@v3
54104

55-
- name: Stop server
56-
run: |
57-
docker stop airport_test_server
105+
- name: Log in to GHCR
106+
uses: docker/login-action@v2
107+
with:
108+
registry: ghcr.io
109+
username: ${{ github.actor }}
110+
password: ${{ secrets.GITHUB_TOKEN }}
58111

59-
- name: Push Docker image to GHCR
112+
- name: Build and push Windows image
60113
run: |
61-
IMAGE_NAME=ghcr.io/query-farm/python-airport-test-server
62-
docker push $IMAGE_NAME:latest
114+
docker build --platform windows/amd64 -t ghcr.io/query-farm/python-airport-test-server:windows-latest .
115+
docker push ghcr.io/query-farm/python-airport-test-server:windows-latest

0 commit comments

Comments
 (0)