diff --git a/.gitea/workflows/docker-publish.yaml b/.gitea/workflows/docker-publish.yaml index a596f61..586f634 100644 --- a/.gitea/workflows/docker-publish.yaml +++ b/.gitea/workflows/docker-publish.yaml @@ -1,9 +1,6 @@ -name: Build and Publish college-bot-v2 -run-name: Build and Publish college-bot-v2 -on: - push: - branches: - - 'master' +name: Build and Publish +run-name: Build and Publish +on: [push] jobs: build_and_publish: @@ -11,24 +8,28 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Build Docker image - run: | - docker build -t git.i-am.nexus/nex/college-bot:latest -t ghcr.io/nexy7574/college-bot:latest . + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: git.i-am.nexus/nex/college-bot-v2 + - name: Log into forgejo CR + if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 with: registry: git.i-am.nexus username: nex password: ${{ secrets.CR_PASSWORD }} - - name: Push to forgejo CR - run: | - docker push git.i-am.nexus/nex/college-bot:latest - - name: Log into GHCR - uses: docker/login-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 with: - registry: ghcr.io - username: nexy7574 - password: ${{ secrets.GHCR_PASSWORD }} - - name: Push to GHCR - run: | - docker push ghcr.io/nexy7574/college-bot:latest \ No newline at end of file + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file