forked from cosmostation/cvms
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.48 KB
/
build.yaml
File metadata and controls
56 lines (48 loc) · 1.48 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
51
52
53
54
55
56
name: CVMS build
on:
workflow_call:
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
# Checkout repository under $GITHUB_WORKSPACE path
- name: Repository checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ github.job }}-${{ runner.os }}-buildx-base
restore-keys: |
${{ github.job }}-${{ runner.os }}-buildx-base
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
# Configure tag name
- name: Sets env vars
run: |
echo "DOCKER_IMAGE_NAME=peersyst/cvms" >> $GITHUB_ENV
# Build docker image
- name: Build docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
if: always()
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache