Generate & publish #8
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: Generate & publish | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v22 | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Generate api | |
run: ./build.nix.sh | |
- name: Push | |
run: | | |
version=v$(curl https://raw.githubusercontent.com/onpremless/api/master/openapi.yaml 2> /dev/null | grep -e "version: '.*'" | cut -d\' -f 2) | |
git config --global user.name "Ilya Sumbatyants" | |
git config --global user.email "[email protected]" | |
git commit -am "Generate api ${version}" | |
git tag ${version} -m "Generate api ${version}" | |
git push origin master | |
git push origin ${version} |