-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4841c07
commit b59118c
Showing
3 changed files
with
104 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Release snapshot of PR | ||
on: | ||
workflow_run: | ||
workflows: ["PR Workflow"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
release-and-comment: | ||
name: Release snapshot and comment in PR | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Download digests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/digests | ||
pattern: digests-* | ||
merge-multiple: true | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ secrets.WORKFLOW_PAT }} | ||
|
||
- name: Download PR number | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/pull_request_number | ||
pattern: pull_request_number | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ secrets.WORKFLOW_PAT }} | ||
|
||
- name: Read the pull_request_number.txt file | ||
id: pull_request_number_reader | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ./pull_request_number/pull_request_number.txt | ||
|
||
- name: Set up Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push | ||
working-directory: /tmp/digests | ||
run: docker buildx imagetools create -t 'ghcr.io/museofficial/muse:pr-${{ github.event.number }}' -t 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}' 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}-arm64' 'ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}-amd64' | ||
|
||
- name: Create comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: "pr-release" | ||
number: ${{ steps.pull_request_number_reader.outputs.content }} | ||
message: | | ||
#### :package: A new release has been made for this pull request. | ||
To play around with this PR, pull `ghcr.io/museofficial/muse:pr-${{ github.event.number }}` or `ghcr.io/museofficial/muse:${{ github.event.pull_request.head.sha }}`. | ||
Images are available for x86_64 and ARM64. | ||
> Latest commit: ${{ github.event.pull_request.head.sha }} |
This file contains 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
This file contains 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