Skip to content

update

update #29

Workflow file for this run

name: Build and Push Docker image to GHCR
on:
push:
branches: [main]
paths:
- 'Dockerfile'
- 'docker/**'
- '**/*.rs'
- '**/*.toml'
- '.github/workflows/**'
permissions:
contents: read
packages: write # パッケージへの書き込み権限を指定:contentReference[oaicite:3]{index=3}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/synpage
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU for multi-arch
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max