aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2023-04-29 00:35:22 +0800
committerMole Shang <[email protected]>2023-04-29 00:35:22 +0800
commit33731ddc2e70a11c5d0fafb56edb79b1ac60236e (patch)
treecac6759a35e7d2420110dbf39baa07e032f8b53e /.github
parent5adbd9abe3e303f18ea980e449a0f714fd9ef106 (diff)
downloadtelegram-mail-bot-33731ddc2e70a11c5d0fafb56edb79b1ac60236e.tar.gz
telegram-mail-bot-33731ddc2e70a11c5d0fafb56edb79b1ac60236e.tar.bz2
telegram-mail-bot-33731ddc2e70a11c5d0fafb56edb79b1ac60236e.zip
ci: setup docker-build workflow
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docker-build.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml
new file mode 100644
index 0000000..c2bcc2f
--- /dev/null
+++ b/.github/workflows/docker-build.yml
@@ -0,0 +1,44 @@
+name: "docker-build"
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - "master"
+ tags:
+ - "v*"
+ pull_request:
+ branches:
+ - "master"
+
+jobs:
+ build:
+ name: "Build"
+ runs-on: ubuntu-latest
+ env:
+ IMAGE_NAME: ${{ github.repository }}
+ steps:
+ - name: Log in to GitHub Packages
+ uses: docker/login-action@v2
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Checkout repo
+ uses: actions/checkout@v2
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@v4
+ with:
+ images: |
+ ghcr.io/${{ env.IMAGE_NAME }}
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v3
+ with:
+ context: .
+ push: ${{ github.event_name != 'pull_request' }}
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}