From 17c09baf89ab3ae060619ee5c4daaba4efe01beb Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 30 Aug 2021 15:45:18 +0100 Subject: [PATCH] Try to automate Docker builds. --- .dockerignore | 7 ++++ .env.build | 2 ++ .github/workflows/docker.yml | 36 +++++++++++++++++++ .github/workflows/{main.yml => mirroring.yml} | 0 4 files changed, 45 insertions(+) create mode 100644 .dockerignore create mode 100644 .env.build create mode 100644 .github/workflows/docker.yml rename .github/workflows/{main.yml => mirroring.yml} (100%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..65084ffd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.github +.vscode +dist +dist_injected +node_modules +.env +.env.local diff --git a/.env.build b/.env.build new file mode 100644 index 00000000..bb995aad --- /dev/null +++ b/.env.build @@ -0,0 +1,2 @@ +API_SERVER=__API_URL__ +THEMES_URL=https://static.revolt.chat/themes \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..4ac924d1 --- /dev/null +++ b/.github/workflows/docker.yml @@ -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 }} diff --git a/.github/workflows/main.yml b/.github/workflows/mirroring.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/mirroring.yml