name: Docker Release on: push: tags: [ v* ] env: IMAGE_NAME: miawinter/just-short-it jobs: build: runs-on: ubuntu-latest strategy: matrix: suffix: ["", "-alpine"] steps: - name: Checkout uses: actions/checkout@v4 - name: Log into the Container registry uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Extract metadata for the image id: meta uses: docker/metadata-action@v5 with: images: ${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}} flavor: | latest=true suffix=${{ matrix.suffix }},onlatest=true labels: | maintainer=Mia Rose Winter org.opencontainers.image.title=Just Short It! org.opencontainers.image.description=The most KISS single user URL shortener there is org.opencontainers.image.url=https://github.com/miawinter98/just-short-it org.opencontainers.image.source=https://github.com/miawinter98/just-short-it org.opencontainers.image.vendor=Winter Software org.opencontainers.image.licenses=MIT - name: Build and push uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64 push: true file: Dockerfile tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} BASE=8.0${{ matrix.suffix }}