From d5dc5ad9a5e56e037ff356c661de9953cca40f76 Mon Sep 17 00:00:00 2001 From: apple Date: Mon, 24 Jun 2024 15:28:07 +0800 Subject: [PATCH] github actions config --- .github/workflows/docker-publish.yml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..fc8a200 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,30 @@ +name: Build and Push Docker Image + +on: + push: + tags: + - '*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.ref }} \ No newline at end of file