Update LICENSE #104
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 Publish Docker Image | |
on: | |
push: | |
branches: [ 'main' ] | |
jobs: | |
docker-build-and-push: | |
name: "Build and Publish Docker Image" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Image Info | |
run: | | |
echo "::set-output name=tag::$(date +'%Y-%m-%d')-${{ github.run_number }}" | |
echo "::set-output name=created::$(date --rfc-3339=seconds | sed 's/ /T/')" | |
id: image_info | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github Packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.github_token }} | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v3 | |
with: | |
load: true | |
tags: keypr:${{ steps.image_info.outputs.tag }} | |
- name: Test | |
run: docker run --rm keypr:${{ steps.image_info.outputs.tag }} | |
- name: Build image and push to GitHub Container Registry | |
uses: docker/build-push-action@v3 | |
with: | |
platforms: linux/amd64 | |
tags: | | |
ghcr.io/fr-platform/keypr:latest | |
ghcr.io/fr-platform/keypr:${{ steps.image_info.outputs.tag }} | |
labels: | | |
org.opencontainers.image.revision=${{ github.sha }} | |
org.opencontainers.image.version=${{ steps.image_info.outputs.tag }} | |
org.opencontainers.image.created=${{ steps.image_info.outputs.created }} | |
push: ${{ github.ref == 'refs/heads/main' }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |