diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml new file mode 100644 index 0000000..2ee2af7 --- /dev/null +++ b/.github/workflows/docker-build-and-push.yml @@ -0,0 +1,56 @@ +name: shpod + +on: + push: + branches: + - 'mastery' + + +jobs: + dockerize: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + # list of Docker images to use as base name for tags + images: | + bretfisher/shpod + # ghcr.io/bretfisher/shpod + # add git short SHA as Docker tag + tag-sha: 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 + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + # name: Login to GHCR + # if: github.event_name != 'pull_request' + # uses: docker/login-action@v1 + # with: + # registry: ghcr.io + # username: ${{ secrets.GHCR_USERNAME }} + # password: ${{ secrets.GHCR_TOKEN }} + # - + name: Build and push clock + uses: docker/build-push-action@v2 + with: + context: vote + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }},bretfisher/shpod:latest + labels: ${{ steps.docker_meta.outputs.labels }} \ No newline at end of file