334df62651
- Adds a Dockerfile within this repository - GitHub actions to build and test the image
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: Deploy docker
|
|
on: [push]
|
|
env:
|
|
DEPLOY_NAME: gollumwiki/gollum:latest
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
steps:
|
|
- name: Check Out Repo
|
|
uses: actions/checkout@v2
|
|
- name: Login
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
- name: Set up Docker Buildx
|
|
id: 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: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ./
|
|
file: ./Dockerfile
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
push: true
|
|
tags: ${{ env.DEPLOY_NAME }}
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }} |