diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..b0239d1 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,60 @@ +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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7749f62 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: GitHub Release + +on: + push: + tags: [ v* ] + +jobs: + build: + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: read + + name: Generate Release + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate Changelog + uses: pfandie/generate-changelog-action@v1.0.6 + id: changelog + with: + config_path: .chglog + next_tag: ${{ github.ref_name }} + + - name: Create Release + uses: ncipollo/release-action@v1.14.0 + with: + makeLatest: true + body: ${{ steps.changelog.outputs.changelog }} + name: "Release ${{ github.ref_name }}" \ No newline at end of file