Merge pull request #815 from buerokratt/v3.3.1 #103
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: Check Version | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| env: | |
| BRANCH: ${{ github.head_ref || github.ref_name }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Docker Setup BuildX | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Generate Changelog | |
| run: npm run changelog | |
| - name: Load environment variables | |
| run: | | |
| awk -v branch="${{ env.BRANCH }}" ' /^[0-9a-zA-Z]+$/ { current_branch = $0; } current_branch == branch && /^[A-Z_]+=/{ print $0; }' release.env >> $GITHUB_ENV | |
| - name: Set repo | |
| run: | | |
| LOWER_CASE_GITHUB_REPOSITORY=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]') | |
| echo "DOCKER_TAG_CUSTOM=ghcr.io/${LOWER_CASE_GITHUB_REPOSITORY}:v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" >> $GITHUB_ENV | |
| echo "$GITHUB_ENV" | |
| - name: Build Docker image | |
| run: | | |
| echo "Building Docker image for branch: ${{ env.BRANCH }} major: ${{ env.MAJOR }} minor: ${{ env.MINOR }} patch: ${{ env.PATCH }}" | |
| cd GUI && docker image build --tag $DOCKER_TAG_CUSTOM --no-cache . | |
| - name: Log in to GitHub container registry | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
| - name: Push Docker image to GitHub Packages | |
| run: | | |
| echo "Pushing Docker image to GitHub Packages" | |
| docker push $DOCKER_TAG_CUSTOM | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }} | |
| generate_release_notes: true | |
| body_path: ${{ github.workspace }}/CHANGELOG.md |