feat: docker 支持自定义 api.json #25
Workflow file for this run
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 image" | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.repository == 'xiaoxuan6/SMSBombing' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
echo "输出版本号:$VERSION" | |
docker build -t ghcr.io/xiaoxuan6/sms-bombing:latest . | |
docker login ghcr.io -u ${{ github.actor }} -p $GITHUB_TOKEN | |
docker push ghcr.io/xiaoxuan6/sms-bombing:latest | |
docker tag ghcr.io/xiaoxuan6/sms-bombing:latest ghcr.io/xiaoxuan6/sms-bombing:$VERSION | |
docker push ghcr.io/xiaoxuan6/sms-bombing:$VERSION | |
docker logout |