45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: "@weekly"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Update Docker configuration
|
|
continue-on-error: true
|
|
run: |
|
|
mkdir -p /etc/default
|
|
mkdir -p /etc/docker
|
|
touch -a /etc/default/docker
|
|
touch -a /etc/docker/daemon.json
|
|
echo "DOCKER_OPTS=\"--insecure-registry ${{ vars.PACKAGES_REGISTRY_URL }}\"" >> /etc/default/docker
|
|
echo "{\"insecure-registries\": [\"${{ vars.PACKAGES_REGISTRY_URL }}\"]}" > /etc/docker/daemon.json
|
|
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Package Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.PACKAGES_REGISTRY_URL }}
|
|
username: ${{ vars.PACKAGES_REGISTRY_USERNAME }}
|
|
password: ${{ secrets.PACKAGES_REGISTRY_PASSWORD }}
|
|
|
|
- name: Build image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: false
|
|
load: true
|
|
tags: ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest
|
|
|
|
- name: Push image
|
|
run: docker push ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest
|