fix html output #97
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: cicd | |
on: | |
push: | |
tags: | |
- '*' | |
branches: [ main ] | |
paths: | |
- '.github/workflows/cicd.yml' | |
- 'sigexport/**' | |
- '.dockerignore' | |
- 'Dockerfile' | |
- 'pyproject.toml' | |
schedule: | |
- cron: '0 2 2 * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set tag env var | |
run: echo "TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV | |
- name: Docker Buildx base image | |
run: | | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
--output "type=image,push=true" \ | |
--tag "carderne/sigexport:$TAG" \ | |
--tag "carderne/sigexport:latest" \ | |
--cache-from "carderne/sigexport:latest" \ | |
--cache-to type=inline \ | |
. | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set tag env var | |
run: echo "TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV | |
- name: test | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: "carderne/sigexport:${{ env.TAG }}" | |
options: -v ${{ github.workspace }}:/fresh | |
run: | | |
cd /fresh | |
PDM_BUILD_SCM_VERSION=0.0.1 pip install . pytest | |
pytest | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
- name: Build | |
run: | | |
pip install build | |
python -m build | |
- name: Publish | |
# mimics: twine upload dist/* --skip-existing | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |