Skip to content

add secret name

add secret name #14

name: Push Docker image to GitHub Container Registry
on:
push:
workflow_dispatch:
jobs:
push_to_registry:
name: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- mediaproxy
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ matrix.name }}-buildx-${{ github.sha }}
restore-keys: |
${{ matrix.name }}-buildx-
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v2
with:
push: true
context: images/${{ matrix.name }}
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64
tags: |
ghcr.io/aokiapp/aokey/${{ matrix.name }}:${{ github.sha }}
ghcr.io/aokiapp/aokey/${{ matrix.name }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-1,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-1 /tmp/.buildx-cache