mirror of
https://github.com/YuzuZensai/Crowdin-Localization-Tools.git
synced 2026-09-13 10:48:58 +00:00
🔧 chore: Rename docker-build.yml to docker-build.yaml
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'index.js'
|
||||
- 'package.json'
|
||||
- 'Dockerfile'
|
||||
- '.github/workflows/docker-build.yml'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'index.js'
|
||||
- 'package.json'
|
||||
- 'Dockerfile'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Prepare repository variables
|
||||
id: prep
|
||||
run: |
|
||||
echo "REPO_NAME=$(echo ${{ github.repository }} | tr '/' ' ' | awk '{print tolower($2)}')" >> $GITHUB_OUTPUT
|
||||
echo "OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: |
|
||||
ghcr.io/${{ steps.prep.outputs.OWNER }}/${{ steps.prep.outputs.REPO_NAME }}:latest
|
||||
ghcr.io/${{ steps.prep.outputs.OWNER }}/${{ steps.prep.outputs.REPO_NAME }}:${{ github.sha }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
Reference in New Issue
Block a user