From 1f325248645f69190b93e3192ec064c5250579f1 Mon Sep 17 00:00:00 2001 From: yp945 Date: Mon, 8 Jul 2024 09:18:55 +0800 Subject: [PATCH] add docker image push ci --- .github/workflows/publish-docker-image.yml | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/publish-docker-image.yml diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml new file mode 100644 index 00000000..0cb67bb2 --- /dev/null +++ b/.github/workflows/publish-docker-image.yml @@ -0,0 +1,30 @@ +name: Build and Publish Docker Image +on: + push: + branches: + - main + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 + +jobs: + setup-build-publish: + name: Setup, Build and Publish + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v2 + with: + push: true + tags: fiammachain/fiammad:${{ github.ref == 'refs/tags/*' && github.ref || github.sha }} \ No newline at end of file