Try to automate Docker builds.

This commit is contained in:
Paul 2021-08-30 15:45:18 +01:00
parent 5631ad8072
commit 17c09baf89
4 changed files with 45 additions and 0 deletions

7
.dockerignore Normal file
View file

@ -0,0 +1,7 @@
.github
.vscode
dist
dist_injected
node_modules
.env
.env.local

2
.env.build Normal file
View file

@ -0,0 +1,2 @@
API_SERVER=__API_URL__
THEMES_URL=https://static.revolt.chat/themes

36
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Docker
on:
push:
branches:
- "master"
tags:
- "v*"
pull_request:
branches:
- "master"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: name/app
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}