Update argus-build-server from folk to simple build-steps #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 argus-api:${{ github.sha }} -f docker/Dockerfile . | |
# Save Docker image as an artifact | |
- name: Save Docker image as artifact | |
run: | | |
docker save argus-api:${{ github.sha }} -o argus-api-${{ 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: argus-api-test | |
path: argus-api-${{ github.sha }}.tar | |
retention-days: 5 |