Skip to content

Commit

Permalink
Use build actions instead of make targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Oct 20, 2024
1 parent f55ba2a commit 42cd531
Showing 1 changed file with 49 additions and 46 deletions.
95 changes: 49 additions & 46 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,56 +34,59 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Show config
run: make show-args

- name: Build minimal image
run: make minimal

- name: Test minimal image
run: make test-minimal

# We can't build statically linked core or latex images
- name: Build core image
if: ${{ matrix.stack != 'static' }}
run: make core

- name: Build LaTeX image
- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ env.PUSH_IMAGE }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: ${{ env.PUSH_IMAGE }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: minimal
uses: ./.github/actions/build
with:
image_type: minimal
base_system: ${{ matrix.stack }}
pandoc_version: ${{ env.PANDOC_VERSION }}

- name: core
uses: ./.github/actions/build
if: ${{ matrix.stack != 'static' }}
run: make latex
with:
image_type: core
base_system: ${{ matrix.stack }}
pandoc_version: ${{ env.PANDOC_VERSION }}

- name: Build Typst image
- name: typst
uses: ./.github/actions/build
if: ${{ matrix.stack != 'static' }}
run: make typst
with:
image_type: minimal
base_system: ${{ matrix.stack }}
pandoc_version: ${{ env.PANDOC_VERSION }}

- name: Build extra image
- name: latex
uses: ./.github/actions/build
if: ${{ matrix.stack != 'static' }}
run: make extra
with:
image_type: latex
base_system: ${{ matrix.stack }}
pandoc_version: ${{ env.PANDOC_VERSION }}

- name: Test core image
- name: extra
uses: ./.github/actions/build
if: ${{ matrix.stack != 'static' }}
run: make test-core

- name: Test LaTeX image
if: ${{ matrix.stack != 'static' }}
run: make test-latex

- name: Test extra image
if: ${{ matrix.stack != 'static' }}
run: make test-extra

- name: Push
if: >-
(github.event_name == 'push' || github.event_name == 'schedule') &&
github.repository == 'pandoc/dockerfiles'
run: |
# Log into registry
echo "${{ secrets.DOCKER_HUB_TOKEN }}" |
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
make push-minimal
if [ "$STACK" != 'static' ]; then
make push-core
make push-typst
make push-latex
make push-extra
fi
with:
image_type: extra
base_system: ${{ matrix.stack }}
pandoc_version: ${{ env.PANDOC_VERSION }}

0 comments on commit 42cd531

Please sign in to comment.