Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Add GitHub workflow to push Docker image

Hugo Müller-Downinga9b1d73d8338
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 000000000..39e78ddf8
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,30 @@
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+
+ build:
+ name: Build, push, and deploy
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout master
+ uses: actions/checkout@v2
+
+ - name: Build PostgresQL container image
+ run: docker build --build-arg DATABASE_TYPE=postgresql --tag docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7) .
+
+ - name: Build MySQL container image
+ run: docker build --build-arg DATABASE_TYPE=mysql --tag docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7) .
+
+ - name: Docker login
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: docker login -u mikecao -p $GITHUB_TOKEN docker.pkg.github.com
+
+ - name: Push image to GitHub
+ run: |
+ docker push docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7)
+ docker push docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7)