1
0
Fork 0
mirror of https://github.com/miawinter98/just-short-it.git synced 2024-11-21 15:59:55 +00:00

updated github actions

This commit is contained in:
Mia Rose Winter 2024-03-29 19:32:13 +01:00
parent a727aca44b
commit 8c9681a573
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 94 additions and 0 deletions

60
.github/workflows/docker.yml vendored Normal file
View file

@ -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 }}

34
.github/workflows/release.yml vendored Normal file
View file

@ -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 }}"