Merge pull request #30 from aisa-it/fix/targetDateFormat #46
Workflow file for this run
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: Build and Push app docker image to github registry | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "true" | |
| - name: Build and Push | |
| uses: dagger/dagger-for-github@v8.1.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| call: build-app --source=. --version=${{ github.ref_name }} --registryUser=${{ github.actor }} --registrySecret=GITHUB_TOKEN --imageName=aisa-it/aiplan | |
| version: "0.18.17" | |
| generate-api: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "true" | |
| token: ${{ secrets.GIT_PAT }} | |
| - name: Config Git | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| git pull origin main | |
| - name: Set up Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Prepare | |
| run: | | |
| npm i -g swagger-typescript-api | |
| - name: Generate API | |
| run: | | |
| cd aiplan-api-ts | |
| git checkout main | |
| npx swagger-typescript-api generate --axios --modular --module-name-first-tag -p ../aiplan.go/internal/aiplan/docs/swagger.json -o ./src/ -n aiplan-api.ts | |
| git add . | |
| git commit -m "new generated API version" || echo "No changes to commit" | |
| yarn version --minor | |
| git push origin main | |
| git push --tags | |
| - name: Get latest submodule commit hash | |
| id: submodule_commit | |
| run: | | |
| cd aiplan-api-ts | |
| echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Update main repository with new submodule reference | |
| run: | | |
| git add aiplan-api-ts | |
| git commit -m "Update api ts submodule to ${{ steps.submodule_commit.outputs.commit_hash }}" | |
| git push origin HEAD:main |