generated from catalyst-cooperative/cheshire
-
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.18 KB
/
docker-build-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: docker-build-push
on: [push, pull_request]
jobs:
push_to_registry:
name: Build Docker image and push to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Docker Metadata
id: docker_metadata
uses: docker/[email protected]
with:
images: catalystcoop/mozilla-sec-eia-docker-build-push
flavor: |
latest=auto
tags: |
type=ref,event=branch
type=ref,event=tag
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image and push to Docker Hub
uses: docker/[email protected]
with:
context: .
file: docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}