Skip to content

Commit

Permalink
ci: Use of context to check files from previous step
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Nov 11, 2023
1 parent 42749ba commit d80bea6
Showing 1 changed file with 17 additions and 30 deletions.
47 changes: 17 additions & 30 deletions .github/workflows/build-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,7 @@ env:
STACK_NAMESPACE: xchem

jobs:
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
build:
runs-on: ubuntu-latest
outputs:
push: ${{ steps.vars.outputs.push }}
Expand Down Expand Up @@ -160,13 +135,25 @@ 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: Download requirements
uses: actions/download-artifact@v3
- 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:
name: requirements
- name: Build
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: Docker build
uses: docker/build-push-action@v4
with:
context: .
tags: ${{ steps.vars.outputs.BE_NAMESPACE }}/fragalysis-backend:${{ steps.vars.outputs.tag }}
# - name: Test
# run: >
Expand Down

0 comments on commit d80bea6

Please sign in to comment.