Skip to content

Commit

Permalink
ci: Another attemnpt to fix the build
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Nov 11, 2023
1 parent fc5f728 commit 42749ba
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.11'
- name: Compile requirements.txt
# We need to put the file in $HOME
# - a simple way to ensure it's
# available between steps in the same job.
run: |
pip install --upgrade pip
pip install poetry==1.5.1
pip install poetry==1.7.0
poetry export --without-hashes --without dev --output requirements.txt
- name: Upload compiled requirements
uses: actions/upload-artifact@v3
Expand Down
59 changes: 36 additions & 23 deletions .github/workflows/build-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,32 @@ env:
STACK_NAMESPACE: xchem

jobs:
build:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Compile requirements.txt
run: |
pip install --upgrade pip
pip install poetry==1.7.0
poetry export --without-hashes --without dev --output requirements.txt
- name: Upload compiled requirements
uses: actions/upload-artifact@v3
with:
name: requirements
path: requirements.txt

build-and-push:
needs: prepare
runs-on: ubuntu-latest
outputs:
push: ${{ steps.vars.outputs.push }}
Expand Down Expand Up @@ -113,30 +138,18 @@ jobs:
# Do we trigger downstream, i.e. is TRIGGER_DOWNSTREAM 'yes'?
echo trigger=${{ env.TRIGGER_DOWNSTREAM == 'yes' }}
echo "trigger=${{ env.TRIGGER_DOWNSTREAM == 'yes' }}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
- name: Set up Python
uses: actions/setup-python@v3
- name: Download requirements
uses: actions/download-artifact@v3
with:
python-version: '3.10'
- name: Compile requirements.txt
run: |
pip install --upgrade pip
pip install poetry==1.5.1
poetry export --without-hashes --without dev --output requirements.txt
name: requirements
- name: Build
uses: docker/build-push-action@v4
with:
context: .
tags: |
${{ steps.vars.outputs.BE_NAMESPACE }}/fragalysis-backend:${{ steps.vars.outputs.tag }}
${{ steps.vars.outputs.BE_NAMESPACE }}/fragalysis-backend:stable
- name: Test
# - name: Test
run: >
docker-compose -f docker-compose.test.yml up
--build
Expand All @@ -145,12 +158,12 @@ jobs:
env:
BE_NAMESPACE: ${{ steps.vars.outputs.BE_NAMESPACE }}
BE_TAG: ${{ steps.vars.outputs.tag }}
- name: Login to DockerHub
if: steps.vars.outputs.push == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to DockerHub
# if: steps.vars.outputs.push == 'true'
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push
if: steps.vars.outputs.push == 'true'
run: |
Expand Down
63 changes: 38 additions & 25 deletions .github/workflows/build-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,32 @@ env:
STACK_NAMESPACE: xchem

jobs:
build:
prepare:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Compile requirements.txt
run: |
pip install --upgrade pip
pip install poetry==1.7.0
poetry export --without-hashes --without dev --output requirements.txt
- name: Upload compiled requirements
uses: actions/upload-artifact@v3
with:
name: requirements
path: requirements.txt

build-and-push:
needs: prepare
runs-on: ubuntu-latest
outputs:
push: ${{ steps.vars.outputs.push }}
Expand Down Expand Up @@ -135,35 +160,23 @@ jobs:
# Do we trigger downstream, i.e. is TRIGGER_DOWNSTREAM 'yes'?
echo trigger=${{ env.TRIGGER_DOWNSTREAM == 'yes' }}
echo "trigger=${{ env.TRIGGER_DOWNSTREAM == 'yes' }}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
- name: Lint Dockerfile
uses: hadolint/[email protected]
- name: Download requirements
uses: actions/download-artifact@v3
with:
dockerfile: Dockerfile
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Compile requirements.txt
run: |
pip install --upgrade pip
pip install poetry==1.5.1
poetry export --without-hashes --without dev --output requirements.txt
name: requirements
- name: Build
uses: docker/build-push-action@v4
with:
tags: ${{ steps.vars.outputs.BE_NAMESPACE }}/fragalysis-backend:${{ steps.vars.outputs.tag }}
- name: Test
run: >
docker-compose -f docker-compose.test.yml up
--build
--exit-code-from tests
--abort-on-container-exit
env:
BE_NAMESPACE: ${{ steps.vars.outputs.BE_NAMESPACE }}
BE_TAG: ${{ steps.vars.outputs.tag }}
# - name: Test
# run: >
# docker-compose -f docker-compose.test.yml up
# --build
# --exit-code-from tests
# --abort-on-container-exit
# env:
# BE_NAMESPACE: ${{ steps.vars.outputs.BE_NAMESPACE }}
# BE_TAG: ${{ steps.vars.outputs.tag }}
- name: Login to DockerHub
if: steps.vars.outputs.push == 'true'
uses: docker/login-action@v2
Expand Down

0 comments on commit 42749ba

Please sign in to comment.