From ec7597e6fa98750da7535e6d09a6c1e38895b85a Mon Sep 17 00:00:00 2001 From: Matt Hills Date: Tue, 15 Apr 2025 20:01:02 -0400 Subject: [PATCH] github actions --- .github/workflows/docker-publish.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 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..cabe595 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,35 @@ +name: Build and Push Docker Image + +on: + push: + tags: + - 'v*' # triggers only on version tags like v1.0.0, v25.04, etc. + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract version from tag + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Build and push Docker image with two tags + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + mattintech/simplefileupload-server:latest + mattintech/simplefileupload-server:${{ env.VERSION }}