Merge pull request #394 from bolshakov/release/v5.3.1 #16
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 ] | |
| jobs: | |
| gem: | |
| name: Ruby Gem 📦 | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@bb6434c747fa7022e12fa1cae2a0951fcffcff26 # v1.253.0 | |
| with: | |
| bundler-cache: true | |
| ruby-version: ruby | |
| - name: Release Gem | |
| uses: rubygems/release-gem@ebe1ec66bd8d2c709ac29aa2b43438d450e7a0a6 # v1 | |
| - name: Get version from gemspec | |
| id: version | |
| run: | | |
| VERSION=$(ruby -e "puts Gem::Specification.load('stoplight.gemspec').version") | |
| echo "version=v$VERSION" >> $GITHUB_OUTPUT | |
| docker: | |
| name: Docker Image 🐳 | |
| needs: [gem] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout Repository | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
| - uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0 | |
| - name: Checkout release | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
| with: | |
| ref: refs/tags/${{ needs.gem.outputs.version }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4.2.1 | |
| with: | |
| push: true | |
| tags: | | |
| bolshakov/stoplight-admin:${{ needs.gem.outputs.version }} | |
| bolshakov/stoplight-admin:latest | |
| platforms: linux/amd64, linux/arm64 | |
| context: . | |
| file: Dockerfile |