diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9c8e699 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,41 @@ +name: Build and publish a Docker image + +on: + push: + tags: + -'*' + - '**' + release: + types: [published] +env: + REGISTRY: docker.io + REP_NAME: swapica/aggregator + IMAGE_NAME: swapica/aggregator:${{ github.ref_name }} + +jobs: + build: + name: Build and publish image + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_LOGIN }} + password: ${{ secrets.DOCKERHUB_PASS }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push Docker images + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ env.IMAGE_NAME }}