2022-02-11 01:29:46 +01:00
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
2020-08-17 12:08:42 +02:00
|
|
|
---
|
|
|
|
name: cd
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*.*.*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release-dockerimage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-07 03:17:52 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-04-15 09:28:08 +02:00
|
|
|
|
2020-08-17 12:08:42 +02:00
|
|
|
- name: Extract dyndnsd version from tag name
|
|
|
|
run: |
|
2022-02-15 23:56:09 +01:00
|
|
|
echo "DYNDNSD_VERSION=${GITHUB_REF#refs/*/v}" >> "$GITHUB_ENV"
|
2021-02-19 16:24:38 +01:00
|
|
|
|
2021-04-16 22:50:07 +02:00
|
|
|
- name: Wait for dyndnsd ${{ env.DYNDNSD_VERSION }} gem to be available
|
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
for retry in $(seq 1 5); do
|
|
|
|
echo "Checking if dyndnsd $DYNDNSD_VERSION gem is retrievable from rubygems.org (try #$retry)..."
|
|
|
|
sudo gem install dyndnsd -v "$DYNDNSD_VERSION"
|
2022-02-15 23:56:09 +01:00
|
|
|
# shellcheck disable=SC2181
|
2021-04-16 22:50:07 +02:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
sleep 60
|
|
|
|
done
|
|
|
|
exit 1
|
|
|
|
|
2020-08-17 12:08:42 +02:00
|
|
|
# https://github.com/marketplace/actions/build-and-push-docker-images
|
2021-02-19 16:24:38 +01:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-14 02:51:56 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-02-19 16:24:38 +01:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2023-09-14 02:51:52 +02:00
|
|
|
uses: docker/login-action@v3
|
2020-08-17 12:08:42 +02:00
|
|
|
with:
|
|
|
|
username: cmur2
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
2021-02-19 16:24:38 +01:00
|
|
|
|
|
|
|
- name: Build and push Docker image for dyndnsd ${{ env.DYNDNSD_VERSION }}
|
2023-09-14 02:51:48 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2021-02-19 16:24:38 +01:00
|
|
|
with:
|
|
|
|
context: docker
|
|
|
|
build-args: |
|
|
|
|
DYNDNSD_VERSION=${{ env.DYNDNSD_VERSION }}
|
|
|
|
push: true
|
|
|
|
tags: cmur2/dyndnsd:v${{ env.DYNDNSD_VERSION }}
|