-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.04 KB
/
docker-build.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
name: Build and Save Docker Image
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout code from repository
- name: Checkout code
uses: actions/checkout@v4
# Set up Docker Buildx (for building multi-platform images)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Build Docker image
- name: Build Docker image
run: |
docker build -t sunet-argus-frontend:${{ github.sha }} -f docker/Dockerfile .
# Save Docker image as an artifact
- name: Save Docker image as artifact
run: |
docker save argus-frontend:${{ github.sha }} -o argus-frontend-${{ github.sha }}.tar
# Ensure the artifact is available for download
continue-on-error: true
# Upload the saved Docker image tarball as an artifact
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: sunet-argus-frontend-test
path: sunet-argus-frontend-${{ github.sha }}.tar
retention-days: 5