Skip to content

Commit

Permalink
Action that triggers docker build on push to main.
Browse files Browse the repository at this point in the history
  • Loading branch information
rousik committed Nov 26, 2023
1 parent a86d8ab commit 59f5e34
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Docker Images
on:
push:
branches:
- main

jobs:
build:
name: Build and push docker images
permissions:
contents: read

runs-on: ubuntu-latest

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

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

- name: Setup Docker Metadata
id: docker_metadata
uses: docker/[email protected]
with:
images: catalystcoop/pudl-output-differ
flavor: latest=auto
tags: |
type=sha,prefix={{branch}}-
type=raw,value=latest-{{branch}}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 59f5e34

Please sign in to comment.