forked from marigold-dev/training-nft-1
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.33 KB
/
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
41
42
43
44
45
name: Docker builds
on:
push:
branches:
- "ghost"
workflow_dispatch: # adding the workflow_dispatch so it can be triggered manually
pull_request:
jobs:
ui:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: true
- name: Set outputs
id: vars
run: |
echo "date=$(date +%Y-%m-%dT%H-%M-%S)" >> "${GITHUB_OUTPUT}"
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Set up Docker Buildx
uses: docker/Setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
if: ${{ github.ref == 'refs/heads/ghost' }}
uses: docker/build-push-action@v3
with:
file: ./solution/Dockerfile
# Only push when on ghost
push: ${{ github.ref == 'refs/heads/ghost' && github.event_name == 'push' }}
tags: |
ghcr.io/marigold-dev/winefactory:latest
ghcr.io/marigold-dev/winefactory:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}
cache-from: type=gha
cache-to: type=gha,mode=max