Publish new version #10
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: Publish new version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Server version (format: Major.Minor.HotFix, example: 1.2.12)' | |
| required: true | |
| prerelease: | |
| description: 'Is Prerelease version' | |
| required: true | |
| type: boolean | |
| jobs: | |
| build: | |
| name: Build and publish | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| platforms: linux/amd64 | |
| - os: ubuntu-24.04-arm | |
| platforms: linux/arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.2.2 | |
| - name: Login to Github packages | |
| uses: docker/login-action@v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GH_TOKEN }} | |
| - name: Login to Docker hub | |
| uses: docker/login-action@v3.4.0 | |
| with: | |
| username: ${{ secrets.DH_USERNAME }} | |
| password: ${{ secrets.DH_TOKEN }} | |
| - name: buildDocker | |
| uses: docker/build-push-action@v6.16.0 | |
| with: | |
| context: . | |
| push: true | |
| platforms: ${{ matrix.platforms }} | |
| tags: pcpl2/easy_image_cdn:latest,pcpl2/easy_image_cdn:${{ github.event.inputs.version }},ghcr.io/pcpl2/easy_image_cdn:latest,ghcr.io/pcpl2/easy_image_cdn:${{ github.event.inputs.version }} | |
| build-args: | | |
| App_Version=${{ github.event.inputs.version }} | |
| createRelease: | |
| name: Create Release ${{ github.event.inputs.version }} | |
| runs-on: ubuntu-latest | |
| needs: [ build ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.2.2 | |
| - name: Create release on github | |
| uses: softprops/action-gh-release@v2.2.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: Release ${{ github.event.inputs.version }} | |
| prerelease: ${{ github.event.inputs.prerelease }} | |
| tag_name: ${{ github.event.inputs.version }} |