diff --git a/.github/workflows/minimap-api-build.yml b/.github/workflows/minimap-api-build.yml index 88cfddda..adbb2ce8 100644 --- a/.github/workflows/minimap-api-build.yml +++ b/.github/workflows/minimap-api-build.yml @@ -2,8 +2,6 @@ name: Build Minimap API Docker Image on: push: - paths: - - 'wowskarma_api_minimap/**' workflow_dispatch: diff --git a/.github/workflows/minimap-api-push.yml b/.github/workflows/minimap-api-push.yml index f2327888..6f2ca1a3 100644 --- a/.github/workflows/minimap-api-push.yml +++ b/.github/workflows/minimap-api-push.yml @@ -6,29 +6,34 @@ on: branches: [ main ] jobs: - release_dockerhub: + build: runs-on: ubuntu-latest + strategy: + matrix: + dockerhub: [ + # { registry: "docker.io", username: "${{ secrets.DOCKERHUB_USERNAME }}", password: "${{ secrets.DOCKERHUB_TOKEN }}" }, + { registry: "ghcr.io", username: "${{ github.actor }}", password: "${{ github.token }}" } + ] + steps: - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} + - uses: actions/checkout@v2 - - name: Push to DockerHub - run: docker push wowskarma_api_minimap:tag + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - release_ghcr: - runs-on: ubuntu-latest - steps: - - name: Login to GHCR - uses: docker/login-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Push to GHCR - run: | - docker tag wowskarma_api_minimap:tag ghcr.io/${{ github.repository }}/wowskarma_api_minimap:tag - docker push ghcr.io/${{ github.repository }}/wowskarma_api_minimap:tag \ No newline at end of file + registry: ${{ matrix.dockerhub.registry }} + username: ${{ matrix.dockerhub.username }} + password: ${{ matrix.dockerhub.password }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: wowskarma_api_minimap:latest,wowskarma_api_minimap:$(date +%Y%m%d),wowskarma_api_minimap:$(git rev-parse --short HEAD) \ No newline at end of file