Merge pull request #155 from PRO-Robotech/feature/dev #147
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: release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - release/* | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| - 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | |
| env: | |
| NODE_VERSION: 20.18.1 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: benjlevesque/[email protected] | |
| id: short-sha | |
| with: | |
| length: 8 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.CUSTOM_DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.CUSTOM_DOCKERHUB_TOKEN }} | |
| - name: Sanitize branch name | |
| id: sanitize | |
| run: echo "branch=$(echo '${{ github.head_ref || github.ref_name }}' | tr '/' '-')" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Dockerfile.build | |
| builder: default | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ secrets.CUSTOM_DOCKERHUB_USERNAME }}/openapi-ui:${{ steps.sanitize.outputs.branch }}-${{ steps.short-sha.outputs.sha }} | |
| build-args: | | |
| NODE_VERSION=${{ env.NODE_VERSION }} |