aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2020-11-18 14:17:11 -0500
committerMax Isom <[email protected]>2020-11-18 14:17:11 -0500
commit5c768adf61e63e807fbf42715c705dd6e6c2a9f5 (patch)
treee353b04c90c18631da10a539252f2590380b7f7b /.github/workflows
parent42fceacf65f38d612c0ca6651ccfe18b295d7f9e (diff)
downloadmuse-5c768adf61e63e807fbf42715c705dd6e6c2a9f5.tar.xz
muse-5c768adf61e63e807fbf42715c705dd6e6c2a9f5.zip
Add workflow to publish image
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml2
-rw-r--r--.github/workflows/publish-image.yml42
2 files changed, 43 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f6c5f1e..9b0afbe 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,6 +1,6 @@
name: Lint & build
-on: [push, pull_request]
+on: [pull_request]
jobs:
build:
diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml
new file mode 100644
index 0000000..c579626
--- /dev/null
+++ b/.github/workflows/publish-image.yml
@@ -0,0 +1,42 @@
+name: Publish Docker image
+
+on:
+ push:
+ branches: master
+
+jobs:
+ main:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Buildx
+ uses: docker/setup-buildx-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:latest
+ platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
+
+ - name: Update Docker Hub description
+ uses: peter-evans/[email protected]
+ env:
+ DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
+ DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
+ DOCKERHUB_REPOSITORY: peterevans/dockerhub-description
+ \ No newline at end of file