diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..d23f6dd6 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ce6c78d3..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: ci - -on: - schedule: - # run on midnight every sunday (on main) - - cron: '0 0 * * 0' - push: - -jobs: - - # Run tests and publish amd64 - build_amd64: - name: Build - actuated - amd64 - runs-on: actuated-8cpu-20gb - 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 - - name: Push image to Docker hub only on main or tag (release) but not on schedule - if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags')) && github.event_name != 'schedule' - run: make docker-push-amd64 - - # Run tests and publish aarch64 - build_aarch64: - name: Build - actuated - aarch64 - runs-on: actuated-arm64-16cpu-20gb - 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 - - name: Push image to Docker hub only on main or tag (release) but not on schedule - if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags')) && github.event_name != 'schedule' - run: make docker-push-aarch64 - - # publish manifest combining aarch64 and amd64 images - publish_manifest: - name: Build and Publish Manifest to Dockerhub - runs-on: ubuntu-latest - needs: [build_amd64, build_aarch64] - if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags')) && github.event_name != 'schedule' - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - - run: make docker-publish-manifest - - # 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 - - # publish documentation on release - publish-docs: - name: Build and publish docs on tag - needs: [build_docs] - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags') && github.event_name != 'schedule' - steps: - - uses: actions/checkout@v3 - - uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - CUSTOM_DOMAIN: sipi.io - CONFIG_FILE: docs/mkdocs.yml - REQUIREMENTS: docs/requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f18b5c8a..ff5c33dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,9 @@ permissions: contents: read on: + schedule: + # run on midnight every day + - cron: '0 0 * * *' push: branches: [ main ] pull_request: