name: Docker Image CI on: workflow_dispatch: workflow_call: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Log in to Docker Hub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: 'Get Previous tag' id: previoustag uses: "WyriHaximus/github-action-get-previous-tag@v1" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Build image and push to Docker Hub and GitHub Container Registry uses: docker/build-push-action@v3 with: context: . tags: | supernova3339/anonupload:latest supernova3339/anonupload:${{ steps.previoustag.outputs.tag }} ghcr.io/supernova3339/anonupload:latest ghcr.io/supernova3339/anonupload:${{ steps.previoustag.outputs.tag }} # build on feature branches, push only on main branch push: ${{ github.ref == 'refs/heads/master' }} platforms: linux/amd64,linux/arm64,linux/arm/v7