Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gdagil committed Nov 8, 2022
1 parent 710cc12 commit 96fdd9f
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker build and push

on:
push:
tags: [ 'v*.*.*' ]

env:
REGISTRY: docker.io
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/cg-streamlit


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
flavor: latest=false
tags: |
type=ref,event=tag
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: "{{defaultContext}}:app"
file: Dockerfile
push: true
tags: |
${{ steps.docker_meta.outputs.tags }}
${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.docker_meta.outputs.labels }}

0 comments on commit 96fdd9f

Please sign in to comment.