Skip to content

Commit

Permalink
feat: autobuild and deploy to docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
rickbassham committed Dec 25, 2020
1 parent 06306fa commit d248767
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: rickbassham/livestack
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
{{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- 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.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install
run: |
npm install semantic-release \
@semantic-release/changelog \
@semantic-release/commit-analyzer \
@semantic-release/git \
@semantic-release/github \
@semantic-release/npm \
@semantic-release/release-notes-generator
- name: release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release --no-dry-run
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"tagFormat": "v${version}",
"dryRun": true,
"ci": false,
"branches": "main",
"branches": "master",
"plugins": [
[
"@semantic-release/commit-analyzer",
Expand Down

0 comments on commit d248767

Please sign in to comment.