From df00c61dd8bb7fa9238aa98939db22229aec0083 Mon Sep 17 00:00:00 2001 From: snowykami Date: Sat, 16 Nov 2024 02:19:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EGitHub=20Actions=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E4=BB=A5=E6=9E=84=E5=BB=BA=E5=92=8C=E6=8E=A8?= =?UTF-8?q?=E9=80=81Docker=E9=95=9C=E5=83=8F=EF=BC=8C=E6=9B=B4=E6=96=B0.gi?= =?UTF-8?q?tignore=E4=BB=A5=E6=8E=92=E9=99=A4.github=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-image.yml | 43 +++++++++++++++++++++++++++++++ .gitignore | 1 - 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-image.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 00000000..f9856033 --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,43 @@ + +name: Docker Image Build + +on: + push: + branches: [main] + + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Harbor + uses: docker/login-action@v2 + with: + registry: git.liteyuki.icu + username: ${{ secrets.GITEA_USERNAME }} + password: ${{ secrets.GITEA_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: git.liteyuki.icu/bot/app:latest + + - name: Log out from Gitea + run: docker logout git.liteyuki.icu diff --git a/.gitignore b/.gitignore index 5c31ef9f..2c64211a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ config.yml config.example.yml # vuepress -.github # mupy mypy.ini