Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
GH action to build container
Browse files Browse the repository at this point in the history
  • Loading branch information
Erin Schnabel committed Jan 12, 2022
1 parent f649edc commit 3ca1ceb
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:

build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# github.repository as <account>/<repo>
images: ${{ github.repository }}

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 3ca1ceb

Please sign in to comment.