Skip to content

Commit a5c3429

Browse files
authored
Merge pull request #60 from hugomd/feat/build-docker-image-with-github-actions
Add GitHub workflow to push Docker image
2 parents 2078005 + 26639db commit a5c3429

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
release:
3+
types: [published]
4+
5+
jobs:
6+
7+
build:
8+
name: Build, push, and deploy
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
- name: Checkout master
13+
uses: actions/checkout@v2
14+
15+
- name: Build PostgresQL container image
16+
run: docker build --build-arg DATABASE_TYPE=postgresql --tag docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7) .
17+
18+
- name: Build MySQL container image
19+
run: docker build --build-arg DATABASE_TYPE=mysql --tag docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7) .
20+
21+
- name: Docker login
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: docker login -u mikecao -p $GITHUB_TOKEN docker.pkg.github.com
25+
26+
- name: Push image to GitHub
27+
run: |
28+
docker push docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7)
29+
docker push docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7)

0 commit comments

Comments
 (0)