aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-12-13 20:25:32 -0500
committerMax Isom <[email protected]>2021-12-13 20:25:32 -0500
commit761ac9f7ed3d446c5a3384a8c2608e82be9cdd34 (patch)
treed087fe615a742b1958e1601586b808bcc9e03f83 /.github/workflows
parent0703193b68a81e0d1cef8867ce2e1950320a72d5 (diff)
downloadmuse-761ac9f7ed3d446c5a3384a8c2608e82be9cdd34.tar.xz
muse-761ac9f7ed3d446c5a3384a8c2608e82be9cdd34.zip
Add PR workflow
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml5
-rw-r--r--.github/workflows/pr.yml70
2 files changed, 74 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c4663dc..75f5729 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,6 +1,9 @@
name: Lint & build
-on: [pull_request]
+on:
+ push:
+ branches:
+ - main
jobs:
build:
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 0000000..fbbc47f
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,70 @@
+name: PR Workflow
+
+on:
+ pull_request:
+ types: [opened, synchronize, ready_for_review, edited, closed]
+ branches:
+ - main
+
+jobs:
+ build:
+ name: Build & lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ node-version: '16'
+
+ - name: Install dependencies
+ uses: bahmutov/npm-install@v1
+
+ - name: Run lint
+ run: yarn lint
+
+ - name: Build
+ run: yarn build
+
+ 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
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-buildx-
+
+ - 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 }}