|
| 1 | +name: build VAuthenticator Management UI config-manager |
| 2 | + |
| 3 | +on: |
| 4 | + push: { } |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + version: |
| 8 | + description: 'make a tag' |
| 9 | + required: false |
| 10 | + type: string |
| 11 | + |
| 12 | + newversion: |
| 13 | + description: 'Next desired version' |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + |
| 17 | +jobs: |
| 18 | + # tag-artifact: |
| 19 | + # if: github.event.inputs.version != '' || github.event.inputs.version != ' ' |
| 20 | + # needs: |
| 21 | + # - build-backend |
| 22 | + # - ui-backend |
| 23 | + # |
| 24 | + # runs-on: ubuntu-22.04 |
| 25 | + # steps: |
| 26 | + # - name: checkout |
| 27 | + # uses: actions/checkout@v4 |
| 28 | + # |
| 29 | + # - name: make an echo |
| 30 | + # run: | |
| 31 | + # echo version ${{github.event.inputs.version}} |
| 32 | + # |
| 33 | + # - name: set the Tag version |
| 34 | + # run: | |
| 35 | + # git config --global user.email "${{ secrets.GIT_EMAIL }}" |
| 36 | + # git config --global user.name "${{ secrets.GIT_USERNAME }}" |
| 37 | + # |
| 38 | + # mvn versions:set -DnewVersion=${{github.event.inputs.version}} |
| 39 | + # git commit -am "[skip-ci] new version release ${{github.event.inputs.version}}" |
| 40 | + # git push |
| 41 | + # |
| 42 | + # - name: Create tag |
| 43 | + # uses: ncipollo/release-action@v1 |
| 44 | + # with: |
| 45 | + # bodyFile: changelog/${{github.event.inputs.version}}.md |
| 46 | + # tag: ${{github.event.inputs.version}} |
| 47 | + # |
| 48 | + # - name: set the Next Development version |
| 49 | + # run: | |
| 50 | + # git config --global user.email "${{ secrets.GIT_EMAIL }}" |
| 51 | + # git config --global user.name "${{ secrets.GIT_USERNAME }}" |
| 52 | + # |
| 53 | + # mvn versions:set -DnewVersion=${{github.event.inputs.newversion}} |
| 54 | + # git commit -am "[skip-ci] new version release ${{github.event.inputs.newversion}}" |
| 55 | + # git push |
| 56 | + |
| 57 | + build-backend: |
| 58 | + runs-on: ubuntu-22.04 |
| 59 | + defaults: |
| 60 | + run: |
| 61 | + working-directory: config-manager |
| 62 | + steps: |
| 63 | + - name: checkout |
| 64 | + uses: actions/checkout@v6 |
| 65 | + |
| 66 | + - name: Set up Golang |
| 67 | + uses: actions/setup-go@v6 |
| 68 | + with: |
| 69 | + go-version: 1.25.1 |
| 70 | + |
| 71 | + - name: Build budget-api package |
| 72 | + run: | |
| 73 | + CGO_ENABLED=0 GOOS=linux go build -o app . |
| 74 | +
|
| 75 | + - name: Run tests |
| 76 | + env: |
| 77 | + AWS_ACCESS_KEY_ID: test |
| 78 | + AWS_SECRET_ACCESS_KEY: test |
| 79 | + AWS_DEFAULT_REGION: us-east-1 |
| 80 | + KAFKA_BROKERS: localhost:9092 |
| 81 | + run: | |
| 82 | + go test -tags test ./... |
| 83 | +
|
| 84 | +
|
| 85 | + - name: docker push |
| 86 | + run: | |
| 87 | + docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} |
| 88 | + |
| 89 | + if [[ ${GITHUB_REF##*/} == 'main' ]] |
| 90 | + then |
| 91 | + DOCKER_TAG="latest" |
| 92 | + else |
| 93 | + DOCKER_TAG="${GITHUB_REF##*/}" |
| 94 | + fi |
| 95 | + |
| 96 | + echo "$DOCKER_TAG" |
| 97 | + docker build -t mrflick72/vauthenticator-config-manager-k8s:$DOCKER_TAG -f application.Dockerfile . |
| 98 | + docker push mrflick72/vauthenticator-config-manager-k8s:$DOCKER_TAG |
0 commit comments