Skip to content

Commit

Permalink
build: push containers to GitHub Packages
Browse files Browse the repository at this point in the history
This creates a manifest of the OCI images, and pushes this to GitHub
Packages.

Signed-off-by: Patrick Uiterwijk <[email protected]>
  • Loading branch information
puiterwijk committed Oct 24, 2022
1 parent a69be40 commit 12da6a5
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
push:
branches:
- main
- '*'
tags:
- "v*.*.*"

Expand Down Expand Up @@ -80,6 +80,48 @@ jobs:
- run: chmod +x ./steward-x86_64-unknown-linux-musl
- run: ./steward-x86_64-unknown-linux-musl --help

push_oci:
needs: build
permissions:
actions: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: steward-aarch64-unknown-linux-musl-oci
- uses: actions/download-artifact@v3
with:
name: steward-x86_64-unknown-linux-musl-oci
- run: skopeo copy docker-archive:./steward-aarch64-unknown-linux-musl-oci containers-storage:localhost/steward:aarch64
- run: skopeo copy docker-archive:./steward-x86_64-unknown-linux-musl-oci containers-storage:localhost/steward:x86_64
- run: podman image ls
- run: podman manifest create steward:manifest
- run: podman manifest add steward:manifest containers-storage:localhost/steward:aarch64 --arch=arm64
- run: podman manifest add steward:manifest containers-storage:localhost/steward:x86_64 --arch=amd64
- run: podman manifest inspect steward:manifest
- name: metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ghcr.io/profianinc/steward
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
sep-tags: " "
- name: add tags
if: github.event_name == 'push'
run: podman tag steward:manifest ${{ steps.metadata.outputs.tags }}
- name: push to GitHub Packages
if: github.event_name == 'push'
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.metadata.outputs.tags }}
username: ${{ github.actor }}
password: ${{ github.token }}

release:
needs: build
permissions:
Expand Down

0 comments on commit 12da6a5

Please sign in to comment.