2020-08-23 10:10:54 +02:00
|
|
|
on:
|
2020-09-06 07:44:56 +02:00
|
|
|
push:
|
|
|
|
branches:
|
2020-09-07 11:15:48 +02:00
|
|
|
- master
|
2022-03-22 12:27:52 +01:00
|
|
|
workflow_dispatch:
|
2020-08-23 10:10:54 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build, push, and deploy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout master
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-09-04 01:32:09 +02:00
|
|
|
- name: Build PostgreSQL container image
|
2022-03-22 12:27:52 +01:00
|
|
|
run: |
|
2020-09-06 07:44:56 +02:00
|
|
|
docker build --build-arg DATABASE_TYPE=postgresql \
|
2022-03-22 12:27:52 +01:00
|
|
|
--tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-${github.ref_name} \
|
2020-09-06 07:44:56 +02:00
|
|
|
--tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest \
|
|
|
|
.
|
2020-08-23 10:10:54 +02:00
|
|
|
|
|
|
|
- name: Build MySQL container image
|
2020-09-06 07:44:56 +02:00
|
|
|
run: |
|
|
|
|
docker build --build-arg DATABASE_TYPE=mysql \
|
2022-03-22 12:27:52 +01:00
|
|
|
--tag ghcr.io/$GITHUB_ACTOR/umami:mysql-${github.ref_name} \
|
2020-09-06 07:44:56 +02:00
|
|
|
--tag ghcr.io/$GITHUB_ACTOR/umami:mysql-latest \
|
|
|
|
.
|
2020-08-23 10:10:54 +02:00
|
|
|
|
|
|
|
- name: Docker login
|
2021-04-09 06:49:41 +02:00
|
|
|
run: >-
|
|
|
|
echo "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
| docker login -u "${{ github.actor }}" --password-stdin ghcr.io
|
2020-08-23 10:10:54 +02:00
|
|
|
|
|
|
|
- name: Push image to GitHub
|
|
|
|
run: |
|
2020-09-06 07:44:56 +02:00
|
|
|
# Push each image individually, avoiding pushing to umami:latest
|
|
|
|
# as MySQL or PostgreSQL are required
|
2022-03-22 12:27:52 +01:00
|
|
|
docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-${github.ref_name}
|
2020-09-06 07:44:56 +02:00
|
|
|
docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest
|
2022-03-22 12:27:52 +01:00
|
|
|
docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-${github.ref_name}
|
2020-09-06 07:44:56 +02:00
|
|
|
docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-latest
|