v1.3.0 #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-main | |
on: | |
release: | |
types: [created] | |
branches: [main, master] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up poetry | |
uses: ./.github/actions/setup-poetry | |
- name: Export tag | |
id: vars | |
run: echo tag=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT | |
- name: Build and publish | |
run: | | |
source .venv/bin/activate | |
poetry version $RELEASE_VERSION | |
make build-and-publish | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ vars.DOCKER_REGISTRY }} | |
username: ${{ vars.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker images | |
env: | |
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} | |
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }} | |
IMAGE_NAME: modpoll | |
TAG: ${{ steps.vars.outputs.tag }} | |
run: | | |
TAG=${TAG#v} | |
IFS='.' read -r MAJOR MINOR PATCH <<< "$TAG" | |
docker buildx build --platform linux/amd64,linux/arm64 -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:$TAG -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:${MAJOR} -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:${MAJOR}.${MINOR} -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:latest --push . | |
deploy-docs: | |
needs: build-and-publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up poetry | |
uses: ./.github/actions/setup-poetry | |
- name: Set up pandoc | |
uses: ./.github/actions/setup-pandoc | |
- name: Build documentation | |
run: make docs | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/_build/html |