-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.55 KB
/
build-push.yaml
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
56
name: Containerize
on:
pull_request:
push:
branches:
- main
- release*
env:
IMAGE_BASE_REGISTRY: quay.io
IMAGE_REGISTRY: quay.io/wspinks0/llm_guard_kitpg
jobs:
push:
runs-on: ubuntu-latest
steps:
# https://github.com/orgs/community/discussions/25678
- name: Delete unnecessary
run: rm -rf /opt/hostedtoolcache
- name: delete more
run: cd /opt && find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
# https://github.com/jlumbroso/free-disk-space
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_BASE_REGISTRY }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Containerfile
push: true
tags: ${{ env.IMAGE_REGISTRY }}:${{ github.ref_name }}, ${{ env.IMAGE_REGISTRY }}:${GITHUB_REF##*/}