diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3a6449c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: Publish Docker image + +on: + push: + +env: + IMAGE_TAG: kenayagi/php-fpm-ext:${{ github.ref_name }} + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: set up docker buildx + uses: docker/setup-buildx-action@v2 + - name: login to the docker hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build and push docker image + uses: docker/build-push-action@v4 + env: + ACTIONS_RUNTIME_TOKEN: '' # https://gitea.com/gitea/act_runner/issues/119 + with: + context: . + no-cache: true + platforms: linux/amd64 + push: true + tags: ${{ env.IMAGE_TAG }} + - name: send telegram message + uses: https://github.com/appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + [Docker] ${{ env.IMAGE_TAG }} has just been released. 🎉