chore: renamed file
This commit is contained in:
parent
68013cc2e7
commit
854ed4c953
1 changed files with 0 additions and 0 deletions
73
.forgejo/workflows/build.yaml
Executable file
73
.forgejo/workflows/build.yaml
Executable file
|
@ -0,0 +1,73 @@
|
|||
name: build container image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
|
||||
release_tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install jq
|
||||
run: apt-get update && apt-get upgrade && apt-get install -y jq
|
||||
|
||||
- name: Get latest release and create new release
|
||||
shell: bash
|
||||
run: |
|
||||
# Get latest release.
|
||||
latest_release=$(curl -s https://git.smail.koeln/api/v1/repos/homelab/docker-ownDynDNS-netcup/releases\?limit\=1 | jq -r '.[] | .tag_name')
|
||||
|
||||
# Cut release into year, month and counter.
|
||||
year=$(echo $latest_release | awk -F '.' '//{print $1}')
|
||||
month=$(echo $latest_release | awk -F '.' '//{print $2}')
|
||||
counter=$(echo $latest_release | awk -F '.' '//{print $3}')
|
||||
|
||||
# increase the counter, if the release is from the same year and month
|
||||
if [ $(date +'%Y') -eq year ] && [ $(date +'%m') -eq month ]; then
|
||||
((counter++));
|
||||
# else reset counter
|
||||
else
|
||||
counter=1;
|
||||
fi
|
||||
|
||||
# Create
|
||||
new_release=$(date +'%Y').$(date +'mY').$counter
|
||||
echo "RELEASE=$new_release">> $GITHUB_ENV
|
||||
|
||||
build:
|
||||
needs: release_tag
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./docker-build
|
||||
file: ./docker-build/Dockerfile
|
||||
platforms: |
|
||||
linux/arm/v7
|
||||
linux/arm64
|
||||
linux/amd64
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKER_USER }}/docker-owndyndns-netcup:${{ env.VERSION }}
|
||||
${{ secrets.DOCKER_USER }}/docker-owndyndns-netcup:latest
|
Loading…
Add table
Add a link
Reference in a new issue