diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml new file mode 100644 index 0000000..7b965ff --- /dev/null +++ b/.github/workflows/build-and-push.yaml @@ -0,0 +1,45 @@ +--- +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: "0" + - id: version + name: Get Version + run: echo "tag=${GITHUB_REF#refs/*/}" >> "${GITHUB_OUTPUT}" + - id: meta + name: Docker meta + uses: docker/metadata-action@v5 + with: + flavor: prefix=v,onlatest=false + images: ghcr.io/${{ github.repository }} + tags: type=semver,pattern={{version}},value=${{ steps.version.outputs.tag }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + password: ${{ secrets.PAT }} + registry: ghcr.io + username: ${{ github.repository_owner }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + build-args: | + hooks=adsbs + cache-from: type=gha + cache-to: type=gha,mode=max + context: . + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} +name: Build and Push +on: + push: + tags: + - "*" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c5e3933..cef924f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,33 +12,6 @@ jobs: id: version name: Bump version and push tag uses: anothrNick/github-tag-action@1.67.0 - - id: meta - name: Docker meta - uses: docker/metadata-action@v5 - with: - flavor: prefix=v,onlatest=false - images: ghcr.io/${{ github.repository }} - tags: type=semver,pattern={{version}},value=${{ steps.version.outputs.new_tag }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - password: ${{ secrets.PAT }} - registry: ghcr.io - username: ${{ github.repository_owner }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - cache-from: type=gha - cache-to: type=gha,mode=max - context: . - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - env: GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_TOKEN: ${{ secrets.PAT }}