-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.36 KB
/
docker-image.yml
File metadata and controls
50 lines (42 loc) · 1.36 KB
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
46
47
48
49
50
name: Build & push Docker image
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
env:
UNITY_VERSION: "2022.1.12f1"
IMAGE_VERSION: "1"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v2.0.0
id: setup-buildx
- name: Cache
uses: actions/cache@v3.0.4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker images
uses: docker/build-push-action@v3.0.0
id: build-push
with:
build-args: |
UNITY_VERSION=${{ env.UNITY_VERSION }}
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
builder: ${{ steps.setup-buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/unity-ci-dotnet:${{ env.UNITY_VERSION}}-codequality-${{ env.IMAGE_VERSION }}
- name: Check output digest
run: echo ${{ steps.build-push.outputs.digest }}