Merge pull request #67 from aisa-it/add/BAK-323 #109
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: "recursive" | |
| #- name: Fetch front submodules | |
| # run: | | |
| # git config submodule.aiplan-api-ts.url https://x-access-token:${{ secrets.GIT_PAT }}@github.com/aisa-it/aiplan-api-ts.git | |
| # cd aiplan-front | |
| # git submodule update --recursive --init | |
| - 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: "false" | |
| token: ${{ secrets.GIT_PAT }} | |
| fetch-depth: 1 | |
| - name: Config Git | |
| run: | | |
| git config submodule.aiplan-api-ts.url https://x-access-token:${{ secrets.GIT_PAT }}@github.com/aisa-it/aiplan-api-ts.git | |
| git submodule update --init aiplan-api-ts | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| - name: Set up Node 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - 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" | |
| 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 |