diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6eba5e4 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,49 @@ +name: build + +on: + push: + branches: + - "master" + tags: + - "v*" + pull_request: + branches: + - "master" + +permissions: + contents: write + +env: + REGISTRY: quay.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Login to Quay.io Container Registry + if: github.actor != 'dependabot[bot]' + uses: docker/login-action@v2 + with: + registry: quay.io + username: utilitywarehouse+drone_ci + password: ${{ secrets.SYSTEM_QUAY_TOKEN }} + - name: Build and push Docker image + if: github.actor != 'dependabot[bot]' + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}