🤖 push 5.0.1 #1153
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| permissions: | |
| contents: write | |
| issues: read | |
| #pull-requests: write # to be able to comment on released pull requests | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false # This is important if you have branch protection rules! | |
| fetch-depth: 0 # semantic-release needs the full history and tags | |
| - name: Semantic Release | |
| id: semantic | |
| uses: cycjimmy/semantic-release-action@v4 | |
| with: | |
| branch: 'main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get Semantic Release Version | |
| id: get-version | |
| # Fall back to the last released version when this run produced no new | |
| # release (e.g. re-runs after a partial failure, or the daily cron). | |
| run: | | |
| VERSION="${{ steps.semantic.outputs.new_release_version }}" | |
| if [ -z "$VERSION" ]; then | |
| VERSION="${{ steps.semantic.outputs.last_release_version }}" | |
| fi | |
| if [ -z "$VERSION" ]; then | |
| echo "Could not determine release version" >&2 | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: show version | |
| run: | | |
| echo "Semantic Release Version: ${{ steps.get-version.outputs.version }}" | |
| - name: setup qemu for multi-arch build | |
| uses: docker/setup-qemu-action@v2 | |
| with: | |
| platforms: amd64,arm64 | |
| - name: setup buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| #registry: registry.hub.docker.com | |
| username: wurstbrot | |
| password: ${{ secrets.HUB_TOKEN }} | |
| - name: create and push yaml image | |
| uses: docker/build-push-action@v3 | |
| with: | |
| push: true | |
| file: Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| tags: wurstbrot/dsomm-yaml-generation:${{ steps.get-version.outputs.version }},wurstbrot/dsomm-yaml-generation:latest | |
| build-args: | | |
| DSOMM_VERSION=${{ steps.get-version.outputs.version }} | |
| GITHUB_REPOSITORY=${{ github.repository }} | |
| - name: Extract generated files from docker image | |
| run: | | |
| docker run -d --name=yaml --entrypoint="/bin/sleep" wurstbrot/dsomm-yaml-generation:${{ steps.get-version.outputs.version }} 60 | |
| docker cp yaml:/var/www/html/generated/model.yaml generated/model.yaml | |
| docker cp yaml:/var/www/html/generated/dependency-tree.md generated/dependency-tree.md | |
| - name: Force add ignored file | |
| run: git add -f generated/model.yaml generated/dependency-tree.md | |
| - name: Commit all changed files back to the repository | |
| uses: planetscale/ghcommit-action@v0.1.6 | |
| with: | |
| commit_message: "🤖 push ${{ steps.get-version.outputs.version }}" | |
| repo: ${{ github.repository }} | |
| branch: ${{ github.head_ref || github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{secrets.ACCESS_TOKEN}} |