Skip to content

publish

publish #2

Workflow file for this run

name: publish
on:
push:
branches:
- main
create:
# This triggers for any tag or branch creation. We'll filter for tags in the job.
jobs:
# Build for release and publish amd64
publish_amd64:
if: github.ref == 'refs/heads/main' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags/'))
name: Publish - 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
- name: Push image to Docker hub
run: make docker-push-amd64
# Build for release and publish aarch64
publish_aarch64:
if: github.ref == 'refs/heads/main' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags/'))
name: Publish - 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
- name: Push image to Docker hub
run: make docker-push-aarch64
# Publish manifest combining aarch64 and amd64 images
publish_manifest:
name: Publish - Manifest
runs-on: ubuntu-latest
needs: [ publish_amd64, publish_aarch64 ]
if: (github.ref_name == 'main' || startsWith(github.ref, 'refs/tags'))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make docker-publish-manifest
# Publish documentation
publish-docs:
name: Publish - docs
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- 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