-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (38 loc) · 1.21 KB
/
build-push-docker.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 Builder Image
on:
push:
branches:
- 'develop'
paths-ignore:
- '**.md'
- '**.rst'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set docker image tag to 'develop'
run: echo "DOCKER_TAG=develop" >> $GITHUB_ENV
- name: Set docker image tag to git tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo "DOCKER_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./
file: ./docker/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
build-args: |
JOBS=2
VERSION=${{ env.DOCKER_TAG }}
push: true
tags: 3dgi/roofer:${{ env.DOCKER_TAG }}
cache-from: type=registry,ref=3dgi/roofer:buildcache
cache-to: type=registry,ref=3dgi/roofer:buildcache,mode=max