Merge pull request #1297 from weseek/dependabot/npm_and_yarn/turbo-2.7.2 #445
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
| # Publish a container image which built app of the target branch to Github Packages so that it can be tried out before release | |
| name: Container - Publish to Github Packages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master] | |
| jobs: | |
| set-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| toolPatterns: ${{ steps.set-tool-version-patterns.outputs.toolPatterns }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/set-tool-version-patterns | |
| id: set-tool-version-patterns | |
| container-publish: | |
| needs: set-matrix | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| strategy: | |
| matrix: | |
| db_tool: ${{ fromJson(needs.set-matrix.outputs.toolPatterns) }} | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up metadata | |
| id: pkg-meta | |
| run: | | |
| echo "package_filter=@awesome-database-backup/awesome-${{ matrix.db_tool.db_type }}-backup" >> $GITHUB_OUTPUT | |
| echo "package_path=apps/awesome-${{ matrix.db_tool.db_type }}-backup" >> $GITHUB_OUTPUT | |
| - uses: ./.github/actions/set-docker-tags-of-app | |
| id: docker-meta | |
| with: | |
| db-type: ${{ matrix.db_tool.db_type }} | |
| db-tool-version: ${{ matrix.db_tool.version }} | |
| registry: ghcr.io | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ghcr.io | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Build and push container | |
| id: push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| build-args: | | |
| packageFilter=${{ steps.pkg-meta.outputs.package_filter }} | |
| packagePath=${{ steps.pkg-meta.outputs.package_path }} | |
| dbType=${{ matrix.db_tool.db_type }} | |
| dbToolVersion=${{ matrix.db_tool.version }} | |
| tags: ${{ steps.docker-meta.outputs.tags }} | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v3 | |
| with: | |
| subject-name: ${{ steps.docker-meta.outputs.image }} | |
| subject-digest: ${{ steps.push.outputs.digest }} | |
| push-to-registry: true | |
| container-publish-slack-notification: | |
| needs: container-publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - if: failure() | |
| name: Slack Notification | |
| uses: weseek/ghaction-release-slack-notification@master | |
| with: | |
| channel: '#srv' | |
| url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| created_tag: ${{ github.ref_name }} |