先試試.. #25
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: Docker Image CI | |
on: | |
push: | |
branches: ["release"] | |
pull_request: | |
branches: ["release"] | |
jobs: | |
checkout: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
tag: | |
runs-on: ubuntu-latest | |
needs: checkout | |
outputs: | |
latest_tag: ${{ steps.latest_tag.outputs.tag }} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Show tags | |
id: latest_tag | |
run: | | |
git fetch --tags | |
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) | |
echo "tag=$latest_tag" >> "$GITHUB_OUTPUT" | |
echo "💡 Latest tag: $latest_tag" | |
docker-QEMU: | |
runs-on: ubuntu-latest | |
needs: checkout | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
docker-login: | |
runs-on: ubuntu-latest | |
needs: checkout | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
docker-build: | |
runs-on: ubuntu-latest | |
needs: tag | |
steps: | |
- name: Build and push tag | |
env: | |
TAG: ${{needs.tag.outputs.latest_tag}} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: smile0301/auto-pixai:$TAG | |
- name: Build and push latest | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: smile0301/auto-pixai:latest |