Publish Docker image #257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker image | |
on: | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ secrets.GH_REPO }} | |
token: ${{ secrets.GH_PAT }} | |
fetch-depth: 0 | |
- name: Checkout latest version | |
run: | | |
version=$(git describe --tags --abbrev=0) | |
git checkout "$version" | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'web/package.json' | |
check-latest: true | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Build frontend | |
run: | | |
pnpm install | |
pnpm build | |
cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ | |
working-directory: ./web | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x | |
push: true | |
tags: ghcr.io/vscodev/kikoeru:latest |