Skip to content

Commit

Permalink
publish docker to github (#19)
Browse files Browse the repository at this point in the history
* publish to github docker

* publish only on push to master

Co-authored-by: Han Wang <[email protected]>
  • Loading branch information
wanghan-iapcm and Han Wang authored Apr 29, 2022
1 parent 8262c6f commit 75039a3
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/pub-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ on:
- 'master'

jobs:
push_to_registry:
push_to_registries:
if: github.repository_owner == 'deepmodeling'
name: Push Docker image to Docker Hub
name: Push Docker image to Docker Hub and ghcr
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -27,13 +30,22 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: dptechnology/dpgen2
images: |
dptechnology/dpgen2
ghcr.io/deepmodeling/dpgen2
- name: Build and push Docker image
- name: Build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
Expand Down

0 comments on commit 75039a3

Please sign in to comment.