-
Notifications
You must be signed in to change notification settings - Fork 8
55 lines (48 loc) · 1.59 KB
/
publishing_llvm_runner.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
46
47
48
49
50
51
52
53
54
55
name: Publish LLVM_runner docker image
on:
pull_request:
branches:
- main
types: [closed]
paths:
- "images/llvm_runner/Dockerfile"
- ".github/workflows/build_llvm_runner.yml"
workflow_dispatch:
branches:
- "main"
jobs:
push_to_registry:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
name: Push Docker image to Docker Hub
runs-on: [self-hosted, ci-runner]
steps:
- uses: actions/checkout@v3
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image on merged PR
if: github.event.pull_request.merged == true
uses: docker/build-push-action@v3
with:
push: true
tags: |
matterlabs/llvm_runner:${{ steps.vars.outputs.sha_short }}
matterlabs/llvm_runner:latest
file: images/llvm_runner/Dockerfile
no-cache: true
- name: Build and push Docker image on manual trigger
if: github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v3
with:
push: true
tags: |
matterlabs/llvm_runner:${{ steps.vars.outputs.sha_short }}
file: images/llvm_runner/Dockerfile
no-cache: true