feat: 🎸 项目初始化 #1
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: Build and Push Docker Images | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract version from tag | |
id: vars | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Build and push xiaoya-alist | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./alist | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/xiaoya-alist:latest | |
ghcr.io/${{ github.repository_owner }}/xiaoya-alist:${{ env.VERSION }} | |
platforms: linux/amd64,linux/arm64 | |
- name: Build and push xiaoya-glue | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./glue | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/xiaoya-glue:latest | |
ghcr.io/${{ github.repository_owner }}/xiaoya-glue:${{ env.VERSION }} | |
platforms: linux/amd64,linux/arm64 | |
- name: Build and push xiaoya-emby | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./emby | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/xiaoya-emby:latest | |
ghcr.io/${{ github.repository_owner }}/xiaoya-emby:${{ env.VERSION }} | |
platforms: linux/amd64,linux/arm64 | |
- name: Build and push xiaoya-jellyfin | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./jellyfin | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/xiaoya-jellyfin:latest | |
ghcr.io/${{ github.repository_owner }}/xiaoya-jellyfin:${{ env.VERSION }} | |
platforms: linux/amd64,linux/arm64 |