diff --git a/.github/workflows/push-image.yml b/.github/workflows/push-image.yml new file mode 100644 index 0000000..ef11ce6 --- /dev/null +++ b/.github/workflows/push-image.yml @@ -0,0 +1,31 @@ +name: "Build and push to GHCR" +on: + push: + branches: [main] + +jobs: + build: + name: Docker build and push + if: > + ${{ !github.event.deleted }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + - name: Login to GitHub Container Registry + uses: docker/login-action@v1.12.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker images + uses: docker/build-push-action@v2.7.0 + with: + builder: ${{ steps.buildx.outputs.name }} + tags: | + ghcr.io/reload/harvester:latest + push: true