|
| 1 | +name: Docker Builds |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - "main" |
| 8 | + - "work" |
| 9 | + tags: |
| 10 | + - "v*.*.*" |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + packages: write |
| 15 | + |
| 16 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + # Get the repositery's code |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + # https://github.com/docker/setup-qemu-action |
| 26 | + - name: Set up QEMU |
| 27 | + uses: docker/setup-qemu-action@v3 |
| 28 | + # https://github.com/docker/setup-buildx-action |
| 29 | + - name: Set up Docker Buildx |
| 30 | + id: buildx |
| 31 | + uses: docker/setup-buildx-action@v3 |
| 32 | + |
| 33 | + # - name: Available platforms |
| 34 | + # run: echo ${{ steps.buildx.outputs.platforms }} |
| 35 | + |
| 36 | + - name: Login to GHCR |
| 37 | + if: github.event_name != 'pull_request' |
| 38 | + uses: docker/login-action@v3 |
| 39 | + with: |
| 40 | + registry: ghcr.io |
| 41 | + username: ${{ github.repository_owner }} |
| 42 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + # - name: Login to Docker Hub |
| 44 | + # if: github.event_name != 'pull_request' |
| 45 | + # uses: docker/login-action@v3 |
| 46 | + # with: |
| 47 | + # username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 48 | + # password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 49 | + - name: Docker meta for PMS |
| 50 | + id: meta_pms |
| 51 | + uses: docker/metadata-action@v5 |
| 52 | + with: |
| 53 | + # list of Docker images to use as base name for tags |
| 54 | + images: | |
| 55 | + raydak-labs/configarr |
| 56 | + # generate Docker tags based on the following events/attributes |
| 57 | + tags: | |
| 58 | + type=schedule |
| 59 | + type=ref,event=branch |
| 60 | + type=semver,pattern={{version}} |
| 61 | + type=semver,pattern={{major}}.{{minor}} |
| 62 | + type=semver,pattern={{major}} |
| 63 | + - name: Build and push PMS |
| 64 | + uses: docker/build-push-action@v5 |
| 65 | + with: |
| 66 | + context: . |
| 67 | + file: ./Dockerfile |
| 68 | + platforms: linux/amd64,linux/arm64,linux/arm/v7 |
| 69 | + push: true |
| 70 | + #push: ${{ github.event_name != 'pull_request' }} |
| 71 | + tags: ${{ steps.meta_pms.outputs.tags }} |
| 72 | + labels: ${{ steps.meta_pms.outputs.labels }} |
| 73 | + # - name: Docker Hub Description |
| 74 | + # if: github.event_name != 'pull_request' |
| 75 | + # uses: peter-evans/dockerhub-description@v3 |
| 76 | + # with: |
| 77 | + # username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 78 | + # password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 79 | + # repository: pabloromeo/clusterplex_pms |
| 80 | + # readme-filepath: ./README.md |
| 81 | + # short-description: "PMS image for ClusterPlex" |
0 commit comments