diff --git a/.github/workflows/build_n_push.yml b/.github/workflows/build_n_push.yml new file mode 100644 index 0000000..9c1e3d2 --- /dev/null +++ b/.github/workflows/build_n_push.yml @@ -0,0 +1,45 @@ +name: "Build and push" + +on: + push: + branches: + - "master" + workflow_dispatch: + +jobs: + build_n_push: + name: Build and push + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: jsondoe9/metube + tags: | + type=sha,prefix=sha-,format=short + type=raw,value=latest,enable=true + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}