diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1230149 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..94217c7 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,72 @@ +name: Docker publish + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + buildandpush: + runs-on: ubuntu-latest + steps: + + # https://github.com/marketplace/actions/checkout + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + # https://github.com/booxmedialtd/ws-action-parse-semver + - name: Parse version + id: semver-version + uses: booxmedialtd/ws-action-parse-semver@v1 + with: + input_string: ${{ steps.package-version.outputs.current-version}} + + # https://github.com/docker/setup-qemu-action#usage + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + # https://github.com/marketplace/actions/docker-setup-buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # https://github.com/docker/login-action#docker-hub + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOKCERHUB_PASSWORD }} + + # https://github.com/docker/metadata-action + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # https://github.com/docker/build-push-action#multi-platform-image + - name: Build and push to Docker Hub + uses: docker/build-push-action@v3 + with: + context: . + push: true + platforms: linux/amd64 + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + + # https://github.com/peter-evans/dockerhub-description + - name: Update repo description + uses: peter-evans/dockerhub-description@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: ${{ github.repository }} + short-description: ${{ github.event.repository.description }}