From 2b0cdb35e4ddddccf02841252877a2ebd685666d Mon Sep 17 00:00:00 2001 From: Yanbing Zhao Date: Tue, 24 Oct 2023 01:38:30 +0800 Subject: [PATCH] Create docker-image.yml --- .github/workflows/docker-image.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..4503fa6 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,33 @@ +name: Create and Publish the Docker Image + +on: + push: + branches: ["master"] + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Login to the Container Registry + uses: docker/login-action@v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Metadata for Docker + id: meta + uses: docker/metadata-action@v5.0.0 + with: + images: ghcr.io/teaconmc/chahoutan + - name: Build and Push Docker Image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}