| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- name: docker hub release
- # build master with multi-arch to docker hub
- on:
- push:
- # Sequence of patterns matched against refs/tags
- tags:
- - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
-
- jobs:
- buildx-dockerhub:
- runs-on: ubuntu-latest
- env:
- DOCKER_REPO: jeessy/backup-x
- DOCKER_PLATFORMS: linux/amd64,linux/arm64
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
- - name: Set up Docker buildx
- uses: docker/setup-buildx-action@v3
- - name: Prepare arguments
- run: |
- echo "VERSION=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
- - name: Docker login # login to docker hub, automatically logout at the end of job
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Run buildx and push
- uses: docker/build-push-action@v3
- with:
- context: .
- push: true # push to docker hub
- platforms: ${{ env.DOCKER_PLATFORMS }}
- tags: |
- ${{ env.DOCKER_REPO }}:latest
- ${{ env.DOCKER_REPO }}:${{ env.VERSION }}
|