Skip to content

Commit

Permalink
build(CI): optimize github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic committed Mar 31, 2024
1 parent ba7420a commit 195bc8a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 100 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: docker-build

on:
push:
branches: [ main ]
pull_request:

jobs:

# Docker build for amd64
build_amd64:
name: Docker Build - amd64
runs-on: buildjet-4vcpu-ubuntu-2204
concurrency:
group: ${{ github.ref }}-amd64
cancel-in-progress: true
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make install-requirements
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-test-build-amd64 # two stage build, where test is run in the first stage
- run: make test-smoke-ci

# Docker build for aarch64
build_aarch64:
name: Docker Build - aarch64
runs-on: buildjet-4vcpu-ubuntu-2204-arm
concurrency:
group: ${{ github.ref }}-aarch64
cancel-in-progress: true
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make install-requirements
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-test-build-aarch64 # two stage build, where test is run in the first stage
- run: make test-smoke-ci

# build documentation
build_docs:
name: Build docs testrun
runs-on: ubuntu-latest
steps:
- uses: dasch-swiss/sipi/.github/actions/checkout@main
with:
DASCHBOT_PAT: ${{ secrets.DASCHBOT_PAT }}
- uses: dasch-swiss/sipi/.github/actions/setup-python@main
- run: make docs-install-requirements
- run: make docs-build
100 changes: 0 additions & 100 deletions .github/workflows/main.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
permissions:
contents: read
on:
schedule:
# run on midnight every day
- cron: '0 0 * * *'
push:
branches: [ main ]
pull_request:
Expand Down

0 comments on commit 195bc8a

Please sign in to comment.