diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 696d1496..94211c9f 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -17,6 +17,25 @@ inputs: runs: using: composite steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + approvers/oreorebot2 + ghcr.io/approvers/oreorebot2 + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -26,15 +45,13 @@ runs: uses: docker/login-action@v2 with: registry: ghcr.io - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ github.token }} - name: Build and push uses: docker/build-push-action@v4 with: push: true - tags: | - approvers/oreorebot2:latest - approvers/oreorebot2:${{ inputs.sha }} - approvers/oreorebot2:v${{ inputs.major }} - approvers/oreorebot2:v${{ inputs.major }}.${{ inputs.minor }} - approvers/oreorebot2:v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max