Publish Cycle #74
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
# Run publish-cycle on main commits. | |
# | |
# Publish cycle comprises: | |
# - publish site, coverage reports and API documentation to https://nigeleke.github.io | |
# | |
name: Publish Cycle | |
on: | |
workflow_run: | |
workflows: ["Acceptance Cycle"] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
publish: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build Site | |
run: | | |
cargo doc --no-deps | |
cargo install cargo-tarpaulin | |
cargo tarpaulin --out html --output-dir target/coverage | |
mkdir docs0 | |
mkdir -p docs0/api | |
mkdir -p docs0/coverage | |
cp README.md docs0/ | |
cp -R target/doc/* docs0/api | |
cp -R target/coverage/tarpaulin-report.html docs0/coverage/index.html | |
cargo tarpaulin --out xml | |
- name: Publish to Codecov | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Build App | |
run: | | |
rm codecov* | |
cargo install dioxus-cli | |
sed -i 's/#base_path/base_path/g' Dioxus.toml | |
dx build --release | |
git stash | |
- name: Publish App & Documentation | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Nigel Eke" | |
export VERSION=$(git describe --abbrev=0 --tags) | |
git checkout gh-pages | |
rm -rf docs | |
mv docs0 docs | |
mkdir docs/app/ | |
mv target/dx/scopa/release/web/public/* docs/app/ | |
git add . | |
git commit -m "Release $VERSION" | |
git push | |
- name: Publish to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/arm64,linux/amd64 | |
- uses: docker/build-push-action@v6 | |
with: | |
file: docker/Dockerfile | |
context: . | |
push: true | |
platforms: linux/arm64,linux/amd64 | |
tags: nigeleke/scopa:latest |