2021-12-14 02:25:32 +01:00
|
|
|
name: PR Workflow
|
|
|
|
|
2021-12-18 19:12:38 +01:00
|
|
|
on: pull_request_target
|
2021-12-14 02:25:32 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Release snapshot
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
2021-12-18 19:12:38 +01:00
|
|
|
key: ${{ runner.os }}-buildx-prs-${{ github.sha }}
|
2021-12-14 02:25:32 +01:00
|
|
|
restore-keys: |
|
2021-12-18 19:12:38 +01:00
|
|
|
${{ runner.os }}-buildx-prs-
|
2021-12-14 02:25:32 +01:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
id: docker_build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
tags: codetheweb/muse:${{ github.event.pull_request.head.sha }}
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
|
|
|
|
|
|
|
|
- name: Create comment
|
|
|
|
uses: marocchino/sticky-pull-request-comment@v2
|
|
|
|
with:
|
|
|
|
header: "pr-release"
|
|
|
|
message: |
|
|
|
|
#### :package: A new release has been made for this pull request
|
|
|
|
|
|
|
|
To play around with this PR, pull `codetheweb/muse:${{ github.event.pull_request.head.sha }}`.
|
|
|
|
|
|
|
|
> Latest commit: ${{ github.event.pull_request.head.sha }}
|