Skip to content

Commit

Permalink
Add github actions for publishing to Docker Hub (#1269)
Browse files Browse the repository at this point in the history
* Add github actions for publishing to Docker Hub

* Update gitignore
  • Loading branch information
tomvlk committed Aug 29, 2023
1 parent af411fa commit c7cdd14
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker-publish-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Docker image for Master builds

on:
push:
branches:
- 'master'

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
platforms: [linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8]
tags: pyplanet/pyplanet:nightly
34 changes: 34 additions & 0 deletions .github/workflows/docker-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker image for official releases

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
platforms: [linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8]
tags: pyplanet/pyplanet:latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ docs/_build/

# dotenv
.env
.venv

# virtualenv
env/
Expand Down

0 comments on commit c7cdd14

Please sign in to comment.