-
Notifications
You must be signed in to change notification settings - Fork 29
44 lines (41 loc) · 1.86 KB
/
docker.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
name: DockerImage
on: [pull_request, push]
jobs:
build-cuttlefish-cloud-orchestration-x86_64-docker-image:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
- name: Get docker image filename and tag
run: |
short_sha=$(echo ${{ github.sha }} | cut -c1-8)
echo "image_path=cloud-orchestration-docker-image-x86_64-${short_sha}.tar" >> $GITHUB_ENV
echo "image_tag=cuttlefish-cloud-orchestration:${short_sha}" >> $GITHUB_ENV
- name: Build docker image
run: docker build --force-rm --no-cache -t ${{ env.image_tag }} .
- name: Save docker image
run: docker save --output ${{ env.image_path }} ${{ env.image_tag }}
- name: Publish docker image
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0
with:
name: docker-image-x86_64
path: ${{ env.image_path }}
build-cuttlefish-cloud-orchestration-arm64-docker-image:
runs-on: arm-ubuntu-arm-22.04-4core
steps:
- name: Checkout repository
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
- name: Get docker image filename and tag
run: |
short_sha=$(echo ${{ github.sha }} | cut -c1-8)
echo "image_path=cloud-orchestration-docker-image-arm64-${short_sha}.tar" >> $GITHUB_ENV
echo "image_tag=cuttlefish-cloud-orchestration:${short_sha}" >> $GITHUB_ENV
- name: Build docker image
run: docker build --force-rm --no-cache -t ${{ env.image_tag }} .
- name: Save docker image
run: docker save --output ${{ env.image_path }} ${{ env.image_tag }}
- name: Publish docker image
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0
with:
name: docker-image-arm64
path: ${{ env.image_path }}