2022-04-30 10:11:22 +00:00
|
|
|
name: Build and Publish Images
|
2021-04-12 13:07:17 +00:00
|
|
|
on:
|
2021-05-13 21:17:28 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-04-12 13:07:17 +00:00
|
|
|
push:
|
2021-05-13 21:17:28 +00:00
|
|
|
branches:
|
2022-04-30 10:11:22 +00:00
|
|
|
- main
|
2022-06-21 23:19:12 +00:00
|
|
|
tags:
|
|
|
|
- "*.*.*"
|
2021-04-12 13:07:17 +00:00
|
|
|
jobs:
|
2022-04-30 10:11:22 +00:00
|
|
|
publish:
|
|
|
|
name: Publish
|
2021-04-12 13:07:17 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-14 21:03:46 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-04-12 13:07:17 +00:00
|
|
|
- name: Prepare
|
|
|
|
id: prep
|
2023-09-12 19:38:35 +00:00
|
|
|
uses: docker/metadata-action@v5.0.0
|
2021-04-12 13:07:17 +00:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
${{ github.repository_owner }}/ftp-server
|
|
|
|
ghcr.io/${{ github.repository_owner }}/ftp-server
|
|
|
|
tags: |
|
|
|
|
type=edge,branch=main
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Set up QEMU
|
2023-09-12 19:31:37 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2021-04-12 13:07:17 +00:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-16 15:34:09 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-04-12 13:07:17 +00:00
|
|
|
- name: Login to DockerHub
|
2021-05-13 21:17:28 +00:00
|
|
|
if: github.event_name != 'pull_request'
|
2023-09-13 20:58:15 +00:00
|
|
|
uses: docker/login-action@v3
|
2021-04-12 13:07:17 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Login to GHCR
|
2021-05-13 21:17:28 +00:00
|
|
|
if: github.event_name != 'pull_request'
|
2023-09-13 20:58:15 +00:00
|
|
|
uses: docker/login-action@v3
|
2021-04-12 13:07:17 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Push
|
2023-09-16 15:15:51 +00:00
|
|
|
uses: docker/build-push-action@v5
|
2021-04-12 13:07:17 +00:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
2021-05-13 21:17:28 +00:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
2021-04-12 13:07:17 +00:00
|
|
|
tags: ${{ steps.prep.outputs.tags }}
|
|
|
|
labels: ${{ steps.prep.outputs.labels }}
|
|
|
|
- name: Update Description
|
|
|
|
continue-on-error: true
|
2022-03-23 00:11:34 +00:00
|
|
|
uses: peter-evans/dockerhub-description@v3
|
2021-04-12 13:07:17 +00:00
|
|
|
with:
|
2021-05-15 13:00:34 +00:00
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
repository: ${{ github.repository_owner }}/ftp-server
|
2021-04-12 13:07:17 +00:00
|
|
|
short-description: ${{ github.event.repository.description }}
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|