Skip to content

⚡️ 修改 docker-compose.yml #9

⚡️ 修改 docker-compose.yml

⚡️ 修改 docker-compose.yml #9

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
push_to_github_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
id-token: write
attestations: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Extract version from package.json
id: get_version
run: |
echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
- name: Build and push Docker image
id: build_push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:latest
platforms: linux/amd64,linux/arm64