mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-11-24 17:18:03 +01:00
cee4239182
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>
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Test, build, publish & deploy
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
tests:
|
|
name: Test
|
|
uses: ./.github/workflows/test.yaml
|
|
push_to_registry:
|
|
name: Push Docker image to Docker Hub
|
|
runs-on: ubuntu-latest
|
|
needs: [tests]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: crocmagnon/checkout:latest
|
|
cache-from: type=registry,ref=crocmagnon/checkout:latest
|
|
cache-to: type=inline
|
|
platforms: linux/amd64
|
|
deploy:
|
|
name: Deploy new image
|
|
runs-on: ubuntu-latest
|
|
needs: [push_to_registry]
|
|
steps:
|
|
- name: Deploy
|
|
run: |
|
|
TEMP=$(mktemp)
|
|
echo "${{ secrets.DEPLOY_KEY }}" > $TEMP
|
|
ssh -o StrictHostKeyChecking=no -i $TEMP -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_USERNAME }}@${{ secrets.DEPLOY_HOST }} /mnt/data/checkout/update
|
|
- name: Check
|
|
uses: nick-fields/retry@v2
|
|
with:
|
|
timeout_seconds: 30
|
|
max_attempts: 5
|
|
retry_wait_seconds: 2
|
|
warning_on_retry: false
|
|
command: curl -sSL --fail -m 10 https://checkout.augendre.info/ping/ | grep ${GITHUB_SHA::7} > /dev/null
|