Skip to content

Commit

Permalink
fix: fix docker build (#4733)
Browse files Browse the repository at this point in the history
* fix: fix docker build

* fix

* fix

* update

* fix tag

* remove branch
  • Loading branch information
asbiin authored Jan 2, 2021
1 parent 755cbfa commit 4fa4561
Showing 1 changed file with 33 additions and 15 deletions.
48 changes: 33 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker
on:
push:
branches:
- 'master'
- master

jobs:
docker-run:
Expand All @@ -13,17 +13,35 @@ jobs:
name: Docker build master

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Build image
uses: docker/build-push-action@v2.2.1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
repository: monicahq/monica/monica
registry: docker.pkg.github.com
dockerfile: scripts/docker/Dockerfile
add_git_labels: true
labels: org.opencontainers.image.version="master"
tags: master
- name: Checkout sources
uses: actions/checkout@v2

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/monicahq/monica
tag-sha: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}

- name: Docker build
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
file: scripts/docker/Dockerfile
context: .

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 4fa4561

Please sign in to comment.