From 8ea29498dc737055a85d82ddb99778a8ba3f33e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?s=E1=B4=A7=E1=B4=8D=E1=B4=9C=E1=B4=87=CA=9F=20=E1=B4=8D?= Date: Tue, 13 Feb 2024 23:57:45 +0000 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7c0dbcd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + tags: + - 'v*' # Trigger on tags that start with 'v' + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build Docker image + run: | + docker build -t sami/brudi-rclone:${{ github.ref }} . + docker tag sami/brudi-rclone:${{ github.ref }} sami/brudi-rclone:latest + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push image to Docker Hub + run: | + docker push sami/brudi-rclone:${{ github.ref }} + docker push sami/brudi-rclone:latest