Skip to content

Commit

Permalink
complete build phase with critical css building and pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaubrey committed Nov 14, 2024
1 parent 167a72b commit 2e39b6e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
build-and-push:
runs-on: ubuntu-latest
needs: [generate-date, tests]
if: github.ref == 'refs/heads/master'
# if: github.ref == 'refs/heads/master'
env:
CONTAINER_REPO: ghcr.io/elifesciences/journal
CONTAINER_TAG: ${{ github.head_ref || github.ref_name }}-${{ github.sha }}-${{ needs.generate-date.outputs.date }}
Expand All @@ -56,7 +56,17 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container image
run: |
docker compose -f 'docker-compose.yml' -f 'docker-compose.ci.yml' build
# Build all images
docker compose -f docker-compose.yml -f docker-compose.ci.yml build
# Build critical CSS
docker compose -f docker-compose.yml -f docker-compose.ci.yml run --name=journal_critical_css critical_css
docker cp journal_critical_css:build/critical-css/. build/critical-css/
# Rebuild app now we have new CSS
docker-compose -f docker-compose.yml -f docker-compose.ci.yml build app
# Retag and push
docker image tag elifesciences/journal:develop ${CONTAINER_REPO}:${CONTAINER_TAG}
- name: Push container image
run: docker push ${CONTAINER_REPO}:${CONTAINER_TAG}

0 comments on commit 2e39b6e

Please sign in to comment.