docker-dotclear/.github/workflows/release_testing.yml

104 lines
3.1 KiB
YAML
Raw Normal View History

2024-11-16 12:43:18 +00:00
name: Build and push testing image
on:
schedule:
2024-12-21 14:39:58 +00:00
- cron: '15 4 * * *'
2024-11-16 12:43:18 +00:00
workflow_dispatch:
env:
2024-11-24 08:09:21 +00:00
DOTCLEAR_IMAGE: docker-dotclear
2024-11-16 12:43:18 +00:00
DOTCLEAR_CANAL: testing
2024-11-24 08:09:21 +00:00
DOCKER_NAMESPACE: jcpd
2024-11-16 12:43:18 +00:00
jobs:
do_image:
2024-11-24 08:09:21 +00:00
name: Build and push testing image
2024-11-16 12:43:18 +00:00
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
2024-12-09 23:37:24 +00:00
- name: Get last dotclear repository tag
id: dotclear
uses: oprypin/find-latest-tag@v1
with:
repository: dotclear/dotclear
- name: version
run: |
SUMMARY=$'Last Dotclear repository tag is ${{ steps.dotclear.outputs.tag }}.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: Create repository branch
id: create
uses: peterjgrainger/action-create-branch@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ steps.dotclear.outputs.tag }}
- name: notcreated
if: (steps.create.outputs.created != 'true')
run: |
SUMMARY=$'Branch ${{ needs.check_image.outputs.version }} has not been created.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: created
if: (steps.create.outputs.created == 'true')
run: |
SUMMARY=$' Branch ${{ needs.check_image.outputs.version }} has been created.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
2024-11-16 12:43:18 +00:00
- name: Check out the repo
uses: actions/checkout@v4
2024-12-09 23:37:24 +00:00
with:
ref: ${{ steps.dotclear.outputs.tag }}
2024-11-16 12:43:18 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
2024-11-24 08:09:21 +00:00
- name: Log in to Github registry
2024-11-24 08:25:08 +00:00
uses: docker/login-action@v3
2024-11-24 08:09:21 +00:00
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case github repository
run: |
echo "GITHUB_REPOSITORY=${REPO,,}" >>${GITHUB_ENV}
env:
REPO: '${{ github.repository }}'
2024-11-16 12:43:18 +00:00
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
sbom: true
push: true
2024-11-24 08:09:21 +00:00
tags: |
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }}
ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ env.DOTCLEAR_CANAL }}
2024-11-16 12:43:18 +00:00
build-args: CANAL=${{ env.DOTCLEAR_CANAL }}
2024-11-24 08:47:32 +00:00
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/V7
cache-from: type=gha
cache-to: type=gha,mode=max
2024-11-16 12:43:18 +00:00
- name: Send Telegram Message Ok
uses: appleboy/telegram-action@master
env:
GITHUB_CONTEXT: ${{toJSON(github)}}
with:
to: ${{ secrets.TELEGRAM_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: Image __${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }}__ successfully generated.