Skip to content

Create docker container #4

Create docker container

Create docker container #4

name: Create docker container
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v2
- name: Setup SSH agent
run: |
eval `ssh-agent`
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/tiiuae/piper
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.http
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
ssh: default=${{ env.SSH_AUTH_SOCK }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}