Merge pull request #42 from Ratio1/develop #42
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 Testnet and Mainnet Images | |
| on: | |
| push: | |
| branches: [main] | |
| # also allow manual runs | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Generate Semantic Version | |
| id: version | |
| uses: PaulHatch/semantic-version@v5.4.0 | |
| with: | |
| tag_prefix: "v" | |
| major_pattern: "(MAJOR)" | |
| minor_pattern: "(feat|feature)" | |
| version_format: "${major}.${minor}.${patch}" | |
| - name: Docker Hub login | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build & Push Testnet Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile_testnet | |
| push: true | |
| platforms: linux/amd64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| VERSION=${{ steps.version.outputs.version }} | |
| tags: | | |
| ratio1/deeploy_ui:testnet | |
| - name: Build & Push Mainnet Image | |
| id: build_image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile_mainnet | |
| push: true | |
| platforms: linux/amd64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| VERSION=${{ steps.version.outputs.version }} | |
| tags: | | |
| ratio1/deeploy_ui:mainnet | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.version_tag }} | |
| name: v${{ steps.version.outputs.version }} | |
| body: | | |
| Docker image details: | |
| - tag: ratio1/deeploy_ui:main | |
| - digest: ${{ steps.build_image.outputs.digest }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |