Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/save-and-restore-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Save-And-Restore Docker Image CI

on:
push:
branches: [ "master" ]
tags:
- '**'

env:
REGISTRY: ghcr.io
IMAGE_NAME: phoebus-save-and-restore

jobs:
build-and-push-image:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract meta-data for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3
- name: Build and publish the Docker image
uses: docker/build-push-action@v5
with:
context: services/save-and-restore
push: true
platforms: linux/amd64
tags: ${{ steps.meta.output.tags }}
labels: ${{ steps.meta.aoutput.labels }}
cache-from: type-gha
cache-to: type-gha,mode=max