54 lines
2.1 KiB
YAML
54 lines
2.1 KiB
YAML
name: Copy full images
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
type: string
|
|
default: 20230903.1.0
|
|
|
|
env:
|
|
SLUG: ${{ github.repository_owner }}/ubuntu
|
|
PUSH_GHCR: ${{ github.repository == (github.event.pull_request.head.repo.full_name || github.repository) && '1' || '' }}
|
|
PUSH_QUAY: ${{ secrets.QUAY_USER && secrets.QUAY_TOKEN && '1' || '' }}
|
|
PUSH_DOCKER_HUB: ${{ secrets.DOCKER_USER && secrets.DOCKER_TOKEN && '1' || '' }}
|
|
|
|
defaults:
|
|
run:
|
|
shell: sh
|
|
|
|
jobs:
|
|
copy:
|
|
name: copy image ${{ matrix.copy.src }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
max-parallel: 1
|
|
matrix:
|
|
copy:
|
|
- src: ghcr.io/christopherhx/runner-images:ubuntu22-runner-usr-local-opt-snap-${{ inputs.version }}
|
|
dest: full-latest
|
|
- src: ghcr.io/christopherhx/runner-images:ubuntu22-runner-usr-local-opt-snap-${{ inputs.version }}
|
|
dest: full-22.04
|
|
- src: ghcr.io/christopherhx/runner-images:ubuntu20-runner-usr-local-opt-snap-${{ inputs.version }}
|
|
dest: full-20.04
|
|
steps:
|
|
- name: Force SLUG to lowercase
|
|
uses: actions/github-script@v6
|
|
with:
|
|
github-token: n/a
|
|
script: |
|
|
core.exportVariable('SLUG', process.env.SLUG.toLowerCase());
|
|
|
|
- name: Login to GitHub Container Registry
|
|
if: env.PUSH_GHCR
|
|
run: skopeo copy -a --src-creds ${{ github.actor }}:${{ github.token }} --dest-creds ${{ github.actor }}:${{ github.token }} docker://${{ matrix.copy.src }} docker://ghcr.io/${{ env.SLUG }}:${{ matrix.copy.dest }}
|
|
|
|
- name: Login to Quay
|
|
if: env.PUSH_QUAY
|
|
run: skopeo copy -a --src-creds ${{ github.actor }}:${{ github.token }} --dest-creds ${{ secrets.QUAY_USER }}:${{ secrets.QUAY_TOKEN }} docker://${{ matrix.copy.src }} docker://quay.io/${{ env.SLUG }}:${{ matrix.copy.dest }}
|
|
|
|
- name: Login to Docker Hub
|
|
if: env.PUSH_DOCKER_HUB
|
|
run: skopeo copy -a --src-creds ${{ github.actor }}:${{ github.token }} --dest-creds ${{ secrets.DOCKER_USER }}:${{ secrets.DOCKER_TOKEN }} docker://${{ matrix.copy.src }} docker://docker.io/${{ env.SLUG }}:${{ matrix.copy.dest }}
|