e52f9cba0d
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
159 lines
4.3 KiB
YAML
159 lines
4.3 KiB
YAML
name: 'Docker Publish'
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
schedule:
|
|
- cron: '0 0 10,20,30 * *'
|
|
|
|
permissions:
|
|
packages: write
|
|
|
|
jobs:
|
|
publish-stable:
|
|
name: Docker Publish
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.event_name != 'schedule' && !contains(github.ref, '-') }}
|
|
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Prepare
|
|
run: echo "TAG=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to ghcr.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: '.'
|
|
file: './Dockerfile'
|
|
platforms: 'linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7'
|
|
push: true
|
|
tags: |
|
|
ttionya/vaultwarden-backup:latest
|
|
ttionya/vaultwarden-backup:${{ env.TAG }}
|
|
ttionya/bitwardenrs-backup:latest
|
|
ttionya/bitwardenrs-backup:${{ env.TAG }}
|
|
ghcr.io/ttionya/vaultwarden-backup:latest
|
|
ghcr.io/ttionya/vaultwarden-backup:${{ env.TAG }}
|
|
|
|
publish-beta:
|
|
name: Docker Publish Beta
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.event_name != 'schedule' && contains(github.ref, '-') }}
|
|
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Prepare
|
|
run: echo "TAG=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: '.'
|
|
file: './Dockerfile'
|
|
platforms: 'linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7'
|
|
push: true
|
|
tags: |
|
|
ttionya/vaultwarden-backup:${{ env.TAG }}
|
|
|
|
publish-schedule:
|
|
name: Docker Publish Schedule
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.event_name == 'schedule' }}
|
|
|
|
steps:
|
|
-
|
|
name: Get Tag
|
|
id: tag
|
|
uses: pozetroninc/github-action-get-latest-release@v0.7.0
|
|
with:
|
|
repository: ${{ github.repository }}
|
|
excludes: prerelease, draft
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: refs/tags/${{ steps.tag.outputs.release }}
|
|
-
|
|
name: Prepare
|
|
run: |
|
|
TAG=${{ steps.tag.outputs.release }}
|
|
echo "TAG=${TAG#v}" >> $GITHUB_ENV
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to ghcr.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: '.'
|
|
file: './Dockerfile'
|
|
platforms: 'linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7'
|
|
push: true
|
|
tags: |
|
|
ttionya/vaultwarden-backup:latest
|
|
ttionya/vaultwarden-backup:${{ env.TAG }}
|
|
ttionya/bitwardenrs-backup:latest
|
|
ttionya/bitwardenrs-backup:${{ env.TAG }}
|
|
ghcr.io/ttionya/vaultwarden-backup:latest
|
|
ghcr.io/ttionya/vaultwarden-backup:${{ env.TAG }}
|