Stirling-PDF/.github/workflows/push-docker.yml

72 lines
1.8 KiB
YAML
Raw Normal View History

name: Push Docker Image with VersionNumber
on:
push:
branches:
- master
- main
jobs:
2023-01-29 19:41:33 +01:00
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
2023-01-29 19:41:33 +01:00
steps:
2023-01-30 21:56:22 +01:00
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v2.3.3
with:
gradle-version: 7.6
arguments: clean build
- name: Make Gradle wrapper executable
run: chmod +x gradlew
- name: Get version number
id: versionNumber
run: echo "::set-output name=versionNumber::$(./gradlew printVersion --quiet | tail -1)"
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_API }}
2023-01-31 20:50:24 +01:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Generate tags
id: meta
uses: docker/metadata-action@v4.4.0
with:
images: |
frooodle/s-pdf
ghcr.io/frooodle/s-pdf
tags: |
${{ steps.versionNumber.outputs.versionNumber }}${{ github.ref == 'refs/heads/main' && '-alpha' || '' }}
2023-01-31 20:50:24 +01:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
2023-01-31 20:50:24 +01:00
- name: Build and push
uses: docker/build-push-action@v4.0.0
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64/v8