A GitHub Action for pushing an OCI archive generated by docker/build-push-action to a remote Docker registry.
pr-mpt/actions-push-oci-archive-to-registry@v1
ID | Description | Default | Examples |
---|---|---|---|
archive |
Path to OCI Archive | required | image.tar |
image |
Docker image | ghcr.io/repository 1 |
ghcr.io/pr-mpt/example pr-mpt/example |
tag |
Tag for the image | latest |
v1.0.0 sha-${{ github.sha }} |
1 ghcr.io/${{ github.repository }}
No outputs.
jobs:
build-image:
runs-on: ubuntu-latest
env:
archive: "oci-image.tar"
steps:
- uses: docker/setup-buildx-action@v1
- uses: docker/setup-qemu-action@v1
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
labels: "${{ steps.meta.outputs.labels }}"
outputs: "type=oci,dest=${{ env.archive }}"
tags: "${{ steps.meta.outputs.tags }}"
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Log in to GitHub Container Registry as actor
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GHCR_PAT }}"
- name: Push OCI archive to remote registry
uses: pr-mpt/actions-push-oci-archive-to-registry
with:
archive: ${{ env.archive }}